github.workflow-run-handle-completion ​
Stop ephemeral runner when workflow_run completes via backend-specific stop workflow
Handle workflow_run completion — stop the ephemeral runner task via backend-specific stop workflow.
This step only acts when action=completed. For other actions (e.g., "created", "requested", "in_progress"), it logs and returns early (no-op).
Stopping logic:
- Finds runner execution linked to this workflow_run_id via execution_metadata
- Dispatches the backend-specific stop workflow (runner.execution-stop, runner.execution-stop-gcp, runner.execution-stop-azure-container-apps, runner.execution-stop-do-app-job) over the bus with WorkflowManager.start_remote, because most of those types are owned by per-cloud libraries this runner image does not install
- Fire-and-forget: this step does NOT wait for the stop to complete, so runner_stopped=True means "stop dispatched", not "runner confirmed gone"
- Idempotent: if execution is already STOPPED/STOPPING, returns early without triggering another stop workflow; the stop workflow id is deterministic per execution, so a redelivered webhook cannot fire a second stop
Inputs:
- action: The webhook action (e.g., "completed")
- github_workflow_run_ref: GitHub workflow run reference
- repository_full_name: Full name "owner/repo"
- run_status: Status from workflow_run
- run_conclusion: Conclusion from workflow_run
- organization_uuid: Organization UUID (public)
Outputs (terminal state_data):
- runner_stopped: True if a stop workflow was dispatched (not confirmation)
- stop_reason: Why the runner was stopped
- runner_execution_uuid: The runner execution UUID that was stopped
- stop_workflow_ref: The workflow reference of the stop workflow (for idempotency)
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-github |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
action | string | Yes | — | Webhook action |
github_workflow_run_ref | integer | No | — | Workflow run ID |
repository_full_name | string | Yes | — | Repository full name |
run_status | string | No | — | Workflow run status |
run_conclusion | string | No | — | Workflow run conclusion |
organization_uuid | string | No | — | Organization UUID (public) |
workflow_run_id | string | No | — | Parent DAG run ID |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
runner_stopped | boolean | No | — | True if a stop workflow was dispatched (not confirmed) |
stop_reason | string | No | — | Why the runner was stopped |
runner_execution_uuid | string | No | — | Runner execution UUID that was stopped |
stop_workflow_ref | string | No | — | Reference of the stop workflow |
action | string | No | — | Webhook action |
github_workflow_run_ref | integer | No | — | Workflow run ID |
repository_full_name | string | No | — | Repository full name |
run_status | string | No | — | Workflow run status |
run_conclusion | string | No | — | Workflow run conclusion |
organization_uuid | string | No | — | Organization UUID (public) |
workflow_run_id | string | No | — | Parent DAG run ID |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "github.workflow-run-handle-completion",
"initial_data": {
"action": "value",
"repository_full_name": "value"
}
}