Monitor and Control Executions

Query execution state, stream progress, and apply supported controls.

Use execution routes as the authoritative view of workflow progress. Provider state can lag or contain unrelated drift; Alfred's execution and stage records describe what the workflow has accepted and completed.

List Executions

curl --fail-with-body --silent --show-error \
  "$ALFRED_API_URL/v1/executions?limit=20" \
  -H "Authorization: Bearer $ALFRED_API_KEY" | jq

Filter by workflow, status, or principal:

curl --fail-with-body --silent --show-error \
  "$ALFRED_API_URL/v1/executions?workflow=add-certificate&status=failed" \
  -H "Authorization: Bearer $ALFRED_API_KEY" | jq

limit defaults to 50 and must be between 1 and 100.

Inspect One Execution

curl --fail-with-body --silent --show-error \
  "$ALFRED_API_URL/v1/executions/$EXECUTION_ID" \
  -H "Authorization: Bearer $ALFRED_API_KEY" | jq

Check these fields in order:

  1. status for the overall outcome.
  2. currentStage for the active or failed boundary.
  3. stages[].status for completed work.
  4. stages[].outputJson for durable results and mutation receipts.
  5. stages[].errorJson for failure context.

Stream Progress

curl -N --fail-with-body \
  "$ALFRED_API_URL/v1/executions/$EXECUTION_ID/events" \
  -H "Accept: text/event-stream" \
  -H "Authorization: Bearer $ALFRED_API_KEY"

Reconnect with the last received event ID to request replay:

curl -N --fail-with-body \
  "$ALFRED_API_URL/v1/executions/$EXECUTION_ID/events" \
  -H "Accept: text/event-stream" \
  -H "Last-Event-ID: $LAST_EVENT_ID" \
  -H "Authorization: Bearer $ALFRED_API_KEY"

Cancel

Cancel an eligible non-terminal execution:

curl --fail-with-body --silent --show-error \
  -X POST "$ALFRED_API_URL/v1/executions/$EXECUTION_ID/cancel" \
  -H "Authorization: Bearer $ALFRED_API_KEY" | jq

Queued commands are canceled before starting. When a Workflow SDK run exists, Alfred sends cancellation to that run and updates the execution projection. An add-subdomain execution stops being cancelable after Route53 accepts its change. Terminal and otherwise ineligible executions return 409 execution_not_cancelable.

Resume or retry

Use the generic resume control for a paused run that still owns its active command lane, or for a failed or canceled update-lambda-version execution:

curl --fail-with-body --silent --show-error \
  -X POST "$ALFRED_API_URL/v1/executions/$EXECUTION_ID/resume" \
  -H "Authorization: Bearer $ALFRED_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}' | jq

Alfred does not expose manual pause. Workflow-owned approval waits remain durable and normally continue through their specific approval route. For example, approve an add-subdomain replacement through POST /v1/executions/{id}/subdomain-plan/approve, not the generic resume route.

For a failed or canceled update-lambda-version execution, the resume endpoint validates the persisted input and queues unfinished work on the existing execution. A newly queued retry returns status: retry_queued; repeating the request while it is pending returns status: retry_already_queued. Other failed or canceled workflows return 409 execution_not_resumable; recover them through Slack or, where supported, by re-submitting the same logical workflow request.

Rolled-back executions and otherwise ineligible states return 409. See Recover Workflows before retrying or rolling back provider work.

Handle Control Responses

StatusMeaning
202Control accepted. Continue monitoring the execution.
404Execution does not exist.
409Current execution state does not allow the control.
501The required controls, retry infrastructure, or Workflow SDK implementation is unavailable.