Trigger environment cleanup when sprint task is tagged
When a teardown tag is added to a sprint task, your removal API gets the task's ID and title, so the environment for that task is reclaimed without anyone doing it by hand.
Install it
Set up this Zap for me, read how here: https://zapier.sh/zapier/awesome-zaps/trigger-environment-cleanup-when-sprint-task-is-tagged/
Paste into Claude, ChatGPT, Cursor or any agent.
- Category
- Engineering · Dev ops
- Author
- Zapier
- Source
- zapier/awesome-zaps, folder zaps/trigger-environment-cleanup-when-sprint-task-is-tagged
Set it up with the CLI
- Add it. Copies the folder into
zaps/trigger-environment-cleanup-when-sprint-task-is-tagged/. Outside a project, it makes one first.npx zap-pack add awesome-zaps/trigger-environment-cleanup-when-sprint-task-is-tagged - Fill in the values in
config.ts, and in any other file the list marks. Replace each one as its comment and SKILL.md say. - Deploy it. Asks for any value still left, signs you in to Zapier if you aren't, then publishes it to your account.
npx zap-pack deploy trigger-environment-cleanup-when-sprint-task-is-tagged - Check it. Its recent runs, with status and errors.
npx zap-pack logs trigger-environment-cleanup-when-sprint-task-is-tagged
zaps/trigger-environment-cleanup-when-sprint-task-is-tagged/
- README.mdWhat it does, for people
- SKILL.mdHow an agent sets it up: what to ask you, and how to test it
- config.tsIts settings 1 to fill in
- connections/asana.tsThe
asanaaccount it uses - triggers/task-tagged.tsWhat starts it:
asanatask_tagged3 to fill in - workflow.tsThe code; each
ctx.stepis a step in the Zap
Agents: add --yes to any command so it never prompts. When it needs an answer only the user can give, it stops and names the flag that supplies it.
SKILL.md
View MarkdownWhat it does
- Trigger: an Asana "Tag Added to Task" trigger (
asana,task_tagged) fires when the teardown tag is added to a task in the configured project. - Webhooks by Zapier POSTs JSON to your removal API with
task_id(the Asana task ID),summary(the task name) andaction: "remove".
The trigger only fires for the one tag and one project you set, so no separate filter step runs.
Ask the user
Each REPLACE_… value is set per person. Resolve names to IDs with the user's own connections; don't ask them to paste an ID you can look up.
| Setting | Where | What goes there |
|---|---|---|
REPLACE_ASANA_WORKSPACE_ID |
triggers/task-tagged.ts, workspace |
The Asana workspace that holds the sprint project |
REPLACE_ASANA_PROJECT_ID |
triggers/task-tagged.ts, project_id |
The sprint project whose tasks get the teardown tag |
REPLACE_ASANA_TAG_ID |
triggers/task-tagged.ts, tag_id |
The tag that means "tear this down" |
REPLACE_REMOVAL_API_URL |
config.ts |
The removal endpoint that receives the teardown POST |
Also check that the teardown tag is one only the teardown process uses, since any tag on the chosen project fires the workflow when it is added. If the removal API expects different field names, change the data object in workflow.ts before installing.
Build it
If you can run shell commands, set it up with zap-pack: run npx zap-pack add awesome-zaps/trigger-environment-cleanup-when-sprint-task-is-tagged, replace each REPLACE_… value as this file says, then run npx zap-pack deploy trigger-environment-cleanup-when-sprint-task-is-tagged, which signs the user in to Zapier when it gets there. Otherwise build with Zapier MCP, as the steps below say. No Zapier MCP tools? Read https://docs.zapier.com/mcp/get-started/quickstart.md and follow the page for the app you are running in to get the user connected, then continue with this build.
- Accounts: bind
asana(the trigger's account, fromtriggers/task-tagged.ts) to the user's Asana connection. Webhooks by Zapier needs no connection. - Source: publish
workflow.tsandconfig.ts, with eachREPLACE_…replaced by the user's answer.triggers/task-tagged.tsandconnections/are settings, not code: set the workflow's trigger and connection bindings from them. The trigger file names the app by its slug; for the trigger'sselected_api, callsearch_triggerswith that slug, find the row whosekeyis the trigger'sevent, and use<app_key>@<app_version>from it. - Build guide: load Zapier's build guide with
get_zapier_skill("zapier:build-workflows")and follow it to create, test and publish the workflow. - Fields: inspect each action's fields with the user's connections and sample the trigger before the first test run, and fix any key in
workflow.tsthat doesn't match.
Test it
Run it once as a draft test with this sample input. It is shaped like an Asana task record, and the name marks it as a test:
{
"gid": "1213589447295574",
"name": "[install-test] synthetic teardown sample"
}
Check that the post-removal-request step shows a POST to the removal URL with task_id, summary and action: "remove" in the body. If run-status tools aren't available, check the result in your removal API directly. Then publish, confirm the trigger is active, and tag a real test task in the chosen project to confirm one run starts from the trigger. Don't run that tag test against a project with live environments. Ask the user to delete the test data, not the agent.
Notes
- The Asana trigger fires on each tag event, so the same task can start more than one removal if its tag is added twice. Make the removal API idempotent.
- Never commit a real removal API URL. Anyone who can reach it can trigger teardowns.
- To customize, add a step after the POST that logs responses to a sheet, or a Slack or email step that reports failed or completed teardowns.