n8nflow.net logo

Detect Unused Android Feature Flags with GitLab, LaunchDarkly, Jira & Slack

by WeblineIndiaUpdated: Last update a month agoSource: n8n.io

Getting Started

Android Feature Flag Cleanup Bot (GitLab + LaunchDarkly)

This n8n automation detects unused (“dead”) feature flags in an Android Kotlin/Java codebase by comparing your GitLab repository code against LaunchDarkly’s feature flag list.

It logs results in Google Sheets, creates Jira tickets for cleanup and sends Slack alerts automatically.

Who’s it for

  • Android engineering teams using Kotlin/Java.
  • Teams managing feature flags in LaunchDarkly.
  • DevOps/QA teams wanting to reduce technical debt from stale flags.

How it works

  1. Weekly Trigger runs the process.
  2. GitLab Node fetches repository code.
  3. Regex Extraction finds all feature flags in code.
  4. LaunchDarkly API retrieves all configured flags.
  5. Comparison Logic marks flags as “dead” if unused in code and archived or off in production.
  6. Google Sheets stores flagged results.
  7. Jira creates a ticket for each dead flag.
  8. Slack notifies the team.

How to set up

  1. Import JSON into n8n.

  2. Connect credentials for:

    • GitLab OAuth2
    • Google Sheets
    • Jira
    • Slack webhook URL
  3. Update:

    • GitLab repo details in the GitLab node.
    • LaunchDarkly API key in HTTP Request node.
    • Google Sheet ID in Google Sheets node.
    • Jira project & issue type in Jira node.
    • Slack message formatting in Slack node.
  4. Activate workflow.

Requirements

  • n8n (self-hosted or cloud)
  • GitLab repository with Kotlin/Java code
  • LaunchDarkly account + API token
  • Google Sheets API access
  • Jira API access
  • Slack incoming webhook

How to customize

  • Change regex pattern in “Detect flags” node if your flag naming convention differs.
  • Adjust dead flag logic in “Find dead flags” node (e.g., treat test env separately).
  • Modify Slack message to include more details (e.g., description from LaunchDarkly).
  • Add email notifications for broader distribution.

Add-ons

  • Email Alerts via Gmail/SMTP.
  • GitHub / GitLab MR to remove dead flags automatically.
  • Confluence Integration to document flag cleanup history.

Use Case Examples

  • Weekly automated cleanup alerts for large engineering teams.
  • Maintaining clean feature flag lists in high-traffic apps.
  • Compliance-driven projects requiring flag lifecycle tracking.

Common troubleshooting

IssuePossible CauseSolution
Workflow fails at GitLab nodeInvalid repo path or missing OAuth scopeUpdate repo path & check GitLab OAuth permissions
LaunchDarkly API request returns 401Invalid or expired API keyGenerate a new API key in LaunchDarkly & update node
Google Sheets node failsWrong Sheet ID or missing sharing permissionsConfirm Sheet ID and share with connected Google account
Jira ticket not createdMissing required fieldsSet project key, issue type, and summary in Jira node
Slack alert not sentWebhook URL invalid or revokedRegenerate Slack webhook and update in node

Need Help?

If you’d like, we can help set up and customize this workflow for your exact repo, flag rules and team notification preferences — including regex adjustments, extra reporting or adding automatic cleanup PRs.

Contact our n8n automation team at WeblineIndia.