Skip to content
Proud to collaborate with Microsoft for Startups

runner.environment-provision-ec2 ​

Provision EC2 Auto Scaling environment for a runner group

Provision EC2 Auto Scaling runner environment for a runner group.

Layers:

  1. validate — check required config, set PROVISIONING
  2. iam — create/validate ecsInstanceRole instance profile
  3. foundation — create ECS cluster + CloudWatch log group (parallel)
  4. resolve_ami — resolve ECS-optimized AMI ID from SSM
  5. launch_template — create EC2 launch template with UserData
  6. asg — create EC2 Auto Scaling Group
  7. capacity_provider — create ECS Capacity Provider backed by the ASG
  8. associate_cp — associate Capacity Provider with the ECS cluster
  9. task_definition — register ECS task definition (bridge / EC2 mode)
  10. register_github — register GitHub runner group (no-op for non-GITHUB)
  11. finalize — sync cached fields, set ACTIVE

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 provisioned, 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.
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.
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——
validate_ec2_environmentjsonNo——
create_iam_instance_profilejsonNo——
create_ec2_ecs_clusterjsonNo——
create_ec2_log_groupjsonNo——
set_log_group_retentionjsonNo——
resolve_ecs_optimized_amijsonNo——
create_launch_templatejsonNo——
create_auto_scaling_groupjsonNo——
create_ec2_capacity_providerjsonNo——
associate_capacity_providerjsonNo——
register_ec2_task_definitionjsonNo——
register_github_runner_groupjsonNo——
finalize_ec2_environmentjsonNo——

DAG Layers ​

#LayerStepsCompensation
1validaterunner.validate_ec2_environment—
2iamrunner.create_iam_instance_profile—
3foundationrunner.create_ec2_ecs_cluster, runner.create_ec2_log_group—
4log_retentionrunner.set_log_group_retention—
5resolve_amirunner.resolve_ecs_optimized_ami—
6launch_templaterunner.create_launch_template—
7asgrunner.create_auto_scaling_group—
8capacity_providerrunner.create_ec2_capacity_provider—
9associate_cprunner.associate_capacity_provider—
10task_definitionrunner.register_ec2_task_definition—
11register_githubrunner.register_github_runner_group—
12finalizerunner.finalize_ec2_environment—

Execution Flow ​

Sub-workflows ​

Sub-workflowStep name
runner.validate_ec2_environmentvalidate_ec2_environment
runner.create_iam_instance_profilecreate_iam_instance_profile
runner.create_ec2_ecs_clustercreate_ec2_ecs_cluster
runner.create_ec2_log_groupcreate_ec2_log_group
runner.set_log_group_retentionset_log_group_retention
runner.resolve_ecs_optimized_amiresolve_ecs_optimized_ami
runner.create_launch_templatecreate_launch_template
runner.create_auto_scaling_groupcreate_auto_scaling_group
runner.create_ec2_capacity_providercreate_ec2_capacity_provider
runner.associate_capacity_providerassociate_capacity_provider
runner.register_ec2_task_definitionregister_ec2_task_definition
runner.register_github_runner_groupregister_github_runner_group
runner.finalize_ec2_environmentfinalize_ec2_environment

API Usage ​

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

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