Skip to content
Proud to collaborate with Microsoft for Startups

runner.environment-deletion-ec2 ​

Delete EC2 Auto Scaling environment for a runner group

Delete EC2 Auto Scaling runner environment for a runner group.

Layers:

  1. load — load cached cluster/task-def/log-group ARNs
  2. stop_active — fail if active executions still running
  3. deregister_cp — disassociate Capacity Provider from cluster
  4. delete_cp — delete ECS Capacity Provider
  5. delete_asg — delete EC2 Auto Scaling Group
  6. delete_taskdef — deregister ECS task definition
  7. delete_lt — delete EC2 Launch Template
  8. delete_iam — delete IAM instance profile (opt-in only)
  9. shared — delete CloudWatch log group + ECS cluster (parallel)
  10. finalize — clear cached fields, set group status

Overview ​

PropertyValue
Workflow typeDag
LibraryApp-runners-aws
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
runner_group_uuiduuidYes—UUID of the RunnerGroup whose EC2 Auto Scaling environment is being deleted, picked from the organization's list of runner groups.
organization_uuiduuidYes—UUID of the caller's organization, injected server-side from the authenticated request; scopes the operation to the correct tenant.
workflow_run_idstringNo——
workflow_run_uuidstringNo—Internal engine correlation/run identifier stamped onto this DAG execution; not a user-facing entity reference and has no picker.

Output Schema ​

FieldTypeRequiredDefaultDescription
runner_group_uuiduuidNo—UUID of the RunnerGroup this workflow operates on, picked from the organization's list of runner groups. Optional on this shared passthrough schema because the same field also appears as an output-only echo.
organization_uuiduuidNo—UUID of the caller's organization, injected server-side from the authenticated request; scopes the operation to the correct tenant.
registry_account_uuiduuidNo—UUID of the container registry account this runner group resolves images against, picked from the organization's registry accounts. Optional — falls back to default/unauthenticated image resolution when absent.
actor_uuiduuidNo—UUID of the user or service actor who triggered this action, injected server-side from the authenticated request when available; used for audit/attribution only.
workflow_run_idstringNo——
workflow_run_uuidstringNo—Legacy alias of workflow_run_id: an internal engine correlation/run identifier for this DAG execution (ADR-015/E1 plumbing), not a foreign key to any business entity. No list/query workflow applies — this is engine-generated, never user-supplied.
workflow_uuidstringNo—Engine workflow-run identifier associated with this record; not a platform entity foreign key despite the name. No list/query workflow applies — this is engine-generated, never user-supplied.
statusstringNo——
outcomestringNo——
initiated_atstringNo——
completed_atstringNo——
failed_atstringNo——
failure_reasonstringNo——
errorstringNo——
error_typestringNo——
reasonstringNo——
failed_stepjsonNo——
failed_layerjsonNo——
failed_at_statejsonNo——
compensation_triggerjsonNo——
comp_current_layerjsonNo——
comp_queuejsonNo——
comp_retry_countjsonNo——
primitive_inputjsonNo——
primitive_outputjsonNo——
load_ec2_environmentjsonNo——
stop_active_executions_ec2jsonNo——
disassociate_capacity_providerjsonNo——
delete_ec2_capacity_providerjsonNo——
delete_auto_scaling_groupjsonNo——
delete_task_definitionjsonNo——
delete_launch_templatejsonNo——
delete_iam_instance_profilejsonNo——
delete_log_groupjsonNo——
delete_clusterjsonNo——
finalize_ec2_environment_deletionjsonNo——

DAG Layers ​

#LayerStepsCompensation
1loadrunner.load_ec2_environment—
2stop_activerunner.stop_active_executions_ec2—
3deregister_cprunner.disassociate_capacity_provider—
4delete_cprunner.delete_ec2_capacity_provider—
5delete_asgrunner.delete_auto_scaling_group—
6delete_taskdefrunner.delete_task_definition—
7delete_ltrunner.delete_launch_template—
8delete_iamrunner.delete_iam_instance_profile—
9sharedrunner.delete_log_group, runner.delete_cluster—
10finalizerunner.finalize_ec2_environment_deletion—

Execution Flow ​

Sub-workflows ​

Sub-workflowStep name
runner.load_ec2_environmentload_ec2_environment
runner.stop_active_executions_ec2stop_active_executions_ec2
runner.disassociate_capacity_providerdisassociate_capacity_provider
runner.delete_ec2_capacity_providerdelete_ec2_capacity_provider
runner.delete_auto_scaling_groupdelete_auto_scaling_group
runner.delete_task_definitiondelete_task_definition
runner.delete_launch_templatedelete_launch_template
runner.delete_iam_instance_profiledelete_iam_instance_profile
runner.delete_log_groupdelete_log_group
runner.delete_clusterdelete_cluster
runner.finalize_ec2_environment_deletionfinalize_ec2_environment_deletion

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "runner.environment-deletion-ec2",
  "initial_data": {
    "runner_group_uuid": "value",
    "organization_uuid": "value"
  }
}