# LaunchDarkly Cross-Project Stale Flag Review Queue (`natstandridge/launchdarkly-stale-flag-queue`) Actor

Turn reduced LaunchDarkly per-project flag lists into one importable cleanup review queue, grouped by project and maintainer team. Uses native stale signals and never archives or deletes a flag.

- **URL**: https://apify.com/natstandridge/launchdarkly-stale-flag-queue.md
- **Developed by:** [Nathaniel Standridge](https://apify.com/natstandridge) (community)
- **Categories:** Developer tools, Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$50.00 / 1,000 delivered cross-project flag reviews

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## LaunchDarkly Cross-Project Stale Flag Review Queue

Turn **buyer-supplied, reduced LaunchDarkly flag-list exports** into one review queue across projects. Each paid dataset row represents a temporary, nonarchived, nondeprecated flag for which LaunchDarkly supplied `stale.readyForCodeRemoval` or `stale.readyToArchive` as `true`. The Actor does not call LaunchDarkly or change any flag.

LaunchDarkly already provides [Cleanup and lifecycle filters](https://launchdarkly.com/docs/guides/flags/technical-debt). Use them for an individual project. This Actor is useful when a team needs one assigned queue from several supplied project lists. It cannot establish that the source covers every project, that the export is current, or that archiving is safe. Review code references, prerequisites, evaluations, and fallback behavior with the owner before a change. See LaunchDarkly's [archiving guidance](https://launchdarkly.com/docs/home/flags/archive).

### Input

`projectsJson` is a JSON array of at most 20 **reduced** project objects. Export all pages from [List feature flags](https://launchdarkly.com/docs/api/feature-flags/list-feature-flags) for each chosen project, then retain only these fields before pasting:

```json
[
  {
    "projectKey": "checkout",
    "totalCount": 1,
    "items": [
      {
        "key": "old-banner",
        "temporary": true,
        "archived": false,
        "deprecated": false,
        "maintainerTeamKey": "frontend",
        "stale": {"readyForCodeRemoval": true, "readyToArchive": false}
      }
    ]
  }
]
```

Each `items` length must equal that project's supplied `totalCount`. This checks that the pasted summary is complete for that project response; it does **not** prove all account projects or flags were selected. If a source field is absent, preserve absence: do not convert an unknown `stale` signal to `false`. Do not paste API tokens, flag names/descriptions, targeting rules, user contexts, or full API responses. The limits are 1,000 flags, 256,000 UTF-8 bytes, and 50 paid findings. `exportedAt` is a required UTC timestamp you declare. The Actor cannot verify it. `maxFindings` defaults to 25; if more qualify, input is rejected without paid delivery so the queue is never silently truncated.

#### Run the synthetic example

The input form is prefilled with this runnable example. It contains two synthetic projects and six flags, producing three paid review findings for **$0.15** at the current price. Replace the sample with your reduced exports before a production run.

```json
{
  "exportedAt": "2026-11-06T12:00:00Z",
  "projectsJson": "[{\"projectKey\":\"checkout\",\"totalCount\":3,\"items\":[{\"key\":\"legacy.checkout\",\"temporary\":true,\"archived\":false,\"deprecated\":false,\"maintainerTeamKey\":\"platform\",\"stale\":{\"readyForCodeRemoval\":true,\"readyToArchive\":true}},{\"key\":\"old-banner\",\"temporary\":true,\"archived\":false,\"deprecated\":false,\"maintainerTeamKey\":\"frontend\",\"stale\":{\"readyForCodeRemoval\":true,\"readyToArchive\":false}},{\"key\":\"payment-circuit\",\"temporary\":false,\"archived\":false,\"deprecated\":false,\"maintainerTeamKey\":\"platform\",\"stale\":{\"readyForCodeRemoval\":false,\"readyToArchive\":false}}]},{\"projectKey\":\"billing\",\"totalCount\":3,\"items\":[{\"key\":\"old-invoice-flow\",\"temporary\":true,\"archived\":false,\"deprecated\":false,\"stale\":{\"readyForCodeRemoval\":true,\"readyToArchive\":true}},{\"key\":\"active-pricing\",\"temporary\":true,\"archived\":false,\"deprecated\":false,\"maintainerTeamKey\":\"billing-team\",\"stale\":{\"readyForCodeRemoval\":false,\"readyToArchive\":false}},{\"key\":\"unknown-evaluations\",\"temporary\":true,\"archived\":false,\"deprecated\":false,\"maintainerTeamKey\":\"billing-team\"}]}]",
  "maxFindings": 25,
  "maxRunSeconds": 120
}
```

The dataset contains these three findings (selected columns shown):

| Project | Flag | Maintainer team | Review state |
| --- | --- | --- | --- |
| billing | old-invoice-flow | not supplied; assignment needed | verify_before_archive |
| checkout | legacy.checkout | platform | verify_before_archive |
| checkout | old-banner | frontend | review_code_removal |

All three rows include the source timestamp, native stale signals, stable observation ID, and review limitations. The free `OUTPUT` summary reports two projects, six source flags, three findings, one excluded permanent flag, one flag without stale signals, and one not-ready flag.

### Output and charging

The dataset contains one row per positive native cleanup signal, with the project and flag keys, maintainer team when supplied, review state, native signal values, and explicit limitations. `reviewState` is a **human review prompt**. `verify_before_archive` does not mean safe to archive. Missing `stale` signals are counted in `OUTPUT` and never billed. Permanent, already archived, deprecated, and not-ready flags are uncharged. Invalid input, an empty queue, and delivery stopped before a dataset write incur no dataset-item event. The current pay-per-event price is **$0.05 per delivered row**. The three-row example costs $0.15; zero delivered rows incur no dataset-item charge. Set a maximum total charge before running.

`OUTPUT` includes source counts, planned/delivered counts, completion status, and scope warnings. The Actor freezes a source-derived `RESULT_PLAN` before delivery and checks the native event count against dataset rows on same-run restart. A budget below the complete row count leaves the dataset empty and `OUTPUT.status=incomplete`, `stopReason=charge_limit`. Uncertain writes stop without an automatic retry. No LaunchDarkly credentials are accepted or used.

### Local validation

```bash
uv sync --frozen --all-groups
uv run --frozen python -B tools/generate_release_fixtures.py
uv run --frozen python -B tools/local_smoke.py
uv run --frozen pytest -q
docker build -t launchdarkly-stale-flag-queue .
```

Cloud export verification (after the coordinator's private test runs):

```bash
uv run --frozen python -B tools/validate_cloud.py /path/to/full examples/cloud-cases.json full
```

The `resurrection` directory is checked against a sibling `full` directory from the same run ID. Do not treat a successful run status alone as qualification.

# Actor input Schema

## `projectsJson` (type: `string`):

Paste a JSON array of up to 20 project objects, each with projectKey, totalCount, and all paginated items from its LaunchDarkly flag-list response. Each item must contain only key, temporary, archived, deprecated, optional maintainerTeamKey, and optional stale with readyForCodeRemoval/readyToArchive booleans. Do not paste a full API response, token, rules, target contexts, names, or descriptions. Total item count must equal totalCount for each supplied project; up to 1,000 flags and 256,000 UTF-8 bytes.

## `exportedAt` (type: `string`):

User-declared export time. The Actor cannot verify source freshness or whether every account project was included.

## `maxFindings` (type: `integer`):

Hard cap. If more flags qualify, the entire input is rejected before paid delivery; narrow the supplied projects or raise this limit.

## `maxRunSeconds` (type: `integer`):

Bounds parsing, checkpointing, and paid dataset delivery.

## Actor input object example

```json
{
  "projectsJson": "[{\"projectKey\":\"checkout\",\"totalCount\":3,\"items\":[{\"key\":\"legacy.checkout\",\"temporary\":true,\"archived\":false,\"deprecated\":false,\"maintainerTeamKey\":\"platform\",\"stale\":{\"readyForCodeRemoval\":true,\"readyToArchive\":true}},{\"key\":\"old-banner\",\"temporary\":true,\"archived\":false,\"deprecated\":false,\"maintainerTeamKey\":\"frontend\",\"stale\":{\"readyForCodeRemoval\":true,\"readyToArchive\":false}},{\"key\":\"payment-circuit\",\"temporary\":false,\"archived\":false,\"deprecated\":false,\"maintainerTeamKey\":\"platform\",\"stale\":{\"readyForCodeRemoval\":false,\"readyToArchive\":false}}]},{\"projectKey\":\"billing\",\"totalCount\":3,\"items\":[{\"key\":\"old-invoice-flow\",\"temporary\":true,\"archived\":false,\"deprecated\":false,\"stale\":{\"readyForCodeRemoval\":true,\"readyToArchive\":true}},{\"key\":\"active-pricing\",\"temporary\":true,\"archived\":false,\"deprecated\":false,\"maintainerTeamKey\":\"billing-team\",\"stale\":{\"readyForCodeRemoval\":false,\"readyToArchive\":false}},{\"key\":\"unknown-evaluations\",\"temporary\":true,\"archived\":false,\"deprecated\":false,\"maintainerTeamKey\":\"billing-team\"}]}]",
  "exportedAt": "2026-11-06T12:00:00Z",
  "maxFindings": 25,
  "maxRunSeconds": 120
}
```

# Actor output Schema

## `findings` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "projectsJson": "[{\"projectKey\":\"checkout\",\"totalCount\":3,\"items\":[{\"key\":\"legacy.checkout\",\"temporary\":true,\"archived\":false,\"deprecated\":false,\"maintainerTeamKey\":\"platform\",\"stale\":{\"readyForCodeRemoval\":true,\"readyToArchive\":true}},{\"key\":\"old-banner\",\"temporary\":true,\"archived\":false,\"deprecated\":false,\"maintainerTeamKey\":\"frontend\",\"stale\":{\"readyForCodeRemoval\":true,\"readyToArchive\":false}},{\"key\":\"payment-circuit\",\"temporary\":false,\"archived\":false,\"deprecated\":false,\"maintainerTeamKey\":\"platform\",\"stale\":{\"readyForCodeRemoval\":false,\"readyToArchive\":false}}]},{\"projectKey\":\"billing\",\"totalCount\":3,\"items\":[{\"key\":\"old-invoice-flow\",\"temporary\":true,\"archived\":false,\"deprecated\":false,\"stale\":{\"readyForCodeRemoval\":true,\"readyToArchive\":true}},{\"key\":\"active-pricing\",\"temporary\":true,\"archived\":false,\"deprecated\":false,\"maintainerTeamKey\":\"billing-team\",\"stale\":{\"readyForCodeRemoval\":false,\"readyToArchive\":false}},{\"key\":\"unknown-evaluations\",\"temporary\":true,\"archived\":false,\"deprecated\":false,\"maintainerTeamKey\":\"billing-team\"}]}]",
    "exportedAt": "2026-11-06T12:00:00Z",
    "maxFindings": 25,
    "maxRunSeconds": 120
};

// Run the Actor and wait for it to finish
const run = await client.actor("natstandridge/launchdarkly-stale-flag-queue").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "projectsJson": "[{\"projectKey\":\"checkout\",\"totalCount\":3,\"items\":[{\"key\":\"legacy.checkout\",\"temporary\":true,\"archived\":false,\"deprecated\":false,\"maintainerTeamKey\":\"platform\",\"stale\":{\"readyForCodeRemoval\":true,\"readyToArchive\":true}},{\"key\":\"old-banner\",\"temporary\":true,\"archived\":false,\"deprecated\":false,\"maintainerTeamKey\":\"frontend\",\"stale\":{\"readyForCodeRemoval\":true,\"readyToArchive\":false}},{\"key\":\"payment-circuit\",\"temporary\":false,\"archived\":false,\"deprecated\":false,\"maintainerTeamKey\":\"platform\",\"stale\":{\"readyForCodeRemoval\":false,\"readyToArchive\":false}}]},{\"projectKey\":\"billing\",\"totalCount\":3,\"items\":[{\"key\":\"old-invoice-flow\",\"temporary\":true,\"archived\":false,\"deprecated\":false,\"stale\":{\"readyForCodeRemoval\":true,\"readyToArchive\":true}},{\"key\":\"active-pricing\",\"temporary\":true,\"archived\":false,\"deprecated\":false,\"maintainerTeamKey\":\"billing-team\",\"stale\":{\"readyForCodeRemoval\":false,\"readyToArchive\":false}},{\"key\":\"unknown-evaluations\",\"temporary\":true,\"archived\":false,\"deprecated\":false,\"maintainerTeamKey\":\"billing-team\"}]}]",
    "exportedAt": "2026-11-06T12:00:00Z",
    "maxFindings": 25,
    "maxRunSeconds": 120,
}

# Run the Actor and wait for it to finish
run = client.actor("natstandridge/launchdarkly-stale-flag-queue").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "projectsJson": "[{\\"projectKey\\":\\"checkout\\",\\"totalCount\\":3,\\"items\\":[{\\"key\\":\\"legacy.checkout\\",\\"temporary\\":true,\\"archived\\":false,\\"deprecated\\":false,\\"maintainerTeamKey\\":\\"platform\\",\\"stale\\":{\\"readyForCodeRemoval\\":true,\\"readyToArchive\\":true}},{\\"key\\":\\"old-banner\\",\\"temporary\\":true,\\"archived\\":false,\\"deprecated\\":false,\\"maintainerTeamKey\\":\\"frontend\\",\\"stale\\":{\\"readyForCodeRemoval\\":true,\\"readyToArchive\\":false}},{\\"key\\":\\"payment-circuit\\",\\"temporary\\":false,\\"archived\\":false,\\"deprecated\\":false,\\"maintainerTeamKey\\":\\"platform\\",\\"stale\\":{\\"readyForCodeRemoval\\":false,\\"readyToArchive\\":false}}]},{\\"projectKey\\":\\"billing\\",\\"totalCount\\":3,\\"items\\":[{\\"key\\":\\"old-invoice-flow\\",\\"temporary\\":true,\\"archived\\":false,\\"deprecated\\":false,\\"stale\\":{\\"readyForCodeRemoval\\":true,\\"readyToArchive\\":true}},{\\"key\\":\\"active-pricing\\",\\"temporary\\":true,\\"archived\\":false,\\"deprecated\\":false,\\"maintainerTeamKey\\":\\"billing-team\\",\\"stale\\":{\\"readyForCodeRemoval\\":false,\\"readyToArchive\\":false}},{\\"key\\":\\"unknown-evaluations\\",\\"temporary\\":true,\\"archived\\":false,\\"deprecated\\":false,\\"maintainerTeamKey\\":\\"billing-team\\"}]}]",
  "exportedAt": "2026-11-06T12:00:00Z",
  "maxFindings": 25,
  "maxRunSeconds": 120
}' |
apify call natstandridge/launchdarkly-stale-flag-queue --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,natstandridge/launchdarkly-stale-flag-queue"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/fBfJe1tuEs5xhYjF5/builds/Kt7WqcH59TLKU4YK9/openapi.json
