Skip to content
Proud to collaborate with Microsoft for Startups

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 ​

PropertyValue
Workflow typeAtomic
LibraryApp-github
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
actionstringYes—Webhook action
github_workflow_run_refintegerNo—Workflow run ID
repository_full_namestringYes—Repository full name
run_statusstringNo—Workflow run status
run_conclusionstringNo—Workflow run conclusion
organization_uuidstringNo—Organization UUID (public)
workflow_run_idstringNo—Parent DAG run ID

Output Schema ​

FieldTypeRequiredDefaultDescription
runner_stoppedbooleanNo—True if a stop workflow was dispatched (not confirmed)
stop_reasonstringNo—Why the runner was stopped
runner_execution_uuidstringNo—Runner execution UUID that was stopped
stop_workflow_refstringNo—Reference of the stop workflow
actionstringNo—Webhook action
github_workflow_run_refintegerNo—Workflow run ID
repository_full_namestringNo—Repository full name
run_statusstringNo—Workflow run status
run_conclusionstringNo—Workflow run conclusion
organization_uuidstringNo—Organization UUID (public)
workflow_run_idstringNo—Parent DAG run ID
failure_reasonstringNo——
failure_typestringNo——
failed_actionstringNo——
failed_at_statestringNo——
failed_stepstringNo——
failed_layerstringNo——
errorstringNo——
error_typestringNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—execute—
completedNoYesYes——
failedNoYesNo——

State Diagram ​

Transitions ​

FromActionToDescription
pendingexecutecompleted—
* (any state)failfailed—

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"
  }
}