LaunchDarkly Automations Auto-archival Settings
You're using a skill that reads and changes a project's auto-archival settings, from the "Automatic archival" section of the project's Settings > Automations page. Auto-archival archives flags without a person in the loop unless approvals are required. Treat every write as production automation with a blast radius.
Prerequisites
This skill requires the remotely hosted LaunchDarkly MCP server.
Required MCP tools:
get-automationswithsection: "archival"andprojectKey: the project's archivalsettingsandautomationsPage, the link to the project's Automations page.update-automationswithprojectKeyand anarchivalobject: change one or more settings, or turn archival off. Omitted fields keep their stored values. Sendarchivalon its own, withoutaccountWide,repo, orcleanup. It cannot turn archival on (see Turn it on).
Optional: get-projects to pick the project, search-members to resolve notification member IDs (team keys come from the user), get-approval-requests for pending archival approvals.
If get-automations has no section argument, or rejects section, the server has not picked up cleanup and archival yet. Ask the user to reconnect the LaunchDarkly MCP server once. If it still has none, guide the browser steps in references/browser-steps.md instead. Do not invent REST calls.
If a call fails with "automatic archival is not available for this account yet", the account does not have the feature. Tell the user and stop; do not retry or try other tools.
What the settings mean
Durations are in seconds. Show them to the user in hours or days.
| Field | Meaning |
|---|---|
enabled |
Whether automatic archival runs for the project |
graceSeconds |
How long a flag that is ready to archive waits before it is archived: 1 hour (3600) to 30 days (2592000) |
requireApproval |
true creates an approval request for each flag instead of archiving it directly |
maxArchivalsPerRun |
The most flags one run archives (1 to 100) |
watchCadenceSeconds |
How often watched flags are rechecked for a status change: 1 minute (60) to 7 days (604800) |
notifyMemberIds, notifyTeamKeys |
Fallback members and teams notified about archival activity. They are not owners: flags with no maintainer are never archived automatically |
configuredByMemberId, riskAcknowledgedAtSeconds |
Read-only: who last saved the settings, and when someone confirmed the risk to turn archival on |
Core Principles
- Confirm before every write. State the current and proposed values, wait for a yes that names the change in this turn, then write. A yes from an earlier turn, or a vague "go ahead", is not enough.
- Only a person can turn it on. Turning archival on requires confirming its risk on the Automations page. Never claim you turned it on.
- Keep approvals unless asked. Never set
requireApprovalto false unless the user explicitly asked to archive without approvals. Say that flags will then be archived without review. - Lists replace.
notifyMemberIdsandnotifyTeamKeysreplace the whole stored list. To add one recipient, read the current list and send it with the new one. - Shorter means sooner. Lowering
graceSecondsor raisingmaxArchivalsPerRunarchives more flags sooner. Say so in the proposal.
Workflows
Read the settings
get-automations with section: "archival" and projectKey. Report whether it is on, the grace period, whether approvals are required, the run limit, and the notification recipients.
Change a setting
Read the settings:
get-automationswithsection: "archival".Propose the change, for example:
Automatic archival in project
defaultwaits 1 day before archiving a ready flag. Change it to 7 days? Ready flags will stay unarchived for a week before they are archived.After the user confirms, call
update-automationswithprojectKey,confirm: true, and anarchivalobject holding only the confirmed fields.The response lists
changedand thesettingsas read back. If it reports a mismatch, or says the settings changed after they were read, show the user the current values fromget-automationswithsection: "archival"and ask again before retrying.
Settings can be changed while archival is off, so a user can set them before a person turns it on.
Turn it off
Propose it ("Turn off automatic archival for project default? No more flags will be archived automatically; flags already archived stay archived."), then update-automations with projectKey, archival: { "enabled": false }, and confirm: true.
Turn it on
The agent cannot turn archival on. If the user asks:
- Read the settings:
get-automationswithsection: "archival", and set any other settings they asked for first (see Change a setting). - Give the user
automationsPage. In the "Automatic archival" section, they turn on Enable automatic archival and confirm the "Enable automatic archival?" dialog. Turning it on requires permission to archive every flag in the project. - When they say it is done, call
get-automationswithsection: "archival"once and report whetherenabledis true. Do not poll.
If update-automations returns applied: false with a nextStep, nothing changed: follow these steps.
Why was (or wasn't) a flag archived automatically?
Read-only. Ask for the flag key if the user did not give one. Then check in this order, and stop at the first cause you can show from a tool result:
get-automationswithsection: "archival":enabledis false, so archival is off for the project.get-flagswithprojectKeyandflagKey: the flag has no maintainer (flags with no maintainer are never archived automatically), or it is already archived (archivedtrue; a flag archived automatically has theauto-archivedtag).get-flag-status-across-envswithallEnvs: true, andget-projectswithprojectKeyandfullSettings: true(settings.lifecycleholds the checks and day thresholds for ready to archive): the flag is still evaluated or does not meet those checks, so it is not ready to archive.requireApprovalis true: look for a pending approval request withget-approval-requests.
These tools do not show when a flag became ready to archive or which flags a run picked. If none of the checks above explains it, say the likely causes without claiming either one: it became ready less than graceSeconds ago, or more flags were ready than maxArchivalsPerRun and the rest wait for a later run.
Flags archived this way get the auto-archived tag. "View auto-archived flags" on the Automations page lists them. Do not change settings to try something.
Errors
- "automatic archival is not available for this account yet": see Prerequisites.
- 403 on a write: the member lacks permission to update the project's lifecycle settings. Say so, and stop.
Out of scope
- Archiving or restoring one flag: use the flag tools.
- Auto-cleanup: use
launchdarkly-automations-cleanup-settings. - Auto-flagging and auto-releasing: use
launchdarkly-release-autopilot-settings.
References
- references/browser-steps.md: the same settings in the browser, for servers without these tools