実行結果の取得

Squadbase API 経由で Automation の実行結果を取得します。

GEThttps://api.squadbase.dev/v0/automation/{projectId}/{automationName}/executions/{executionId}/result

Automation の実行結果を返します。このエンドポイントは常に 200 OK を返します。実行中は output が null で、status だけが意味を持ちます。

リクエストヘッダー

Prop

Type

Required

パスパラメータ

Prop

Type

Required

レスポンス — 200 OK

Prop

Type

{
  "executionId": "uuid",
  "projectId": "uuid",
  "automationName": "daily-sales-alert",
  "status": "COMPLETED",
  "output": "前日の売上は 3 商品で前週同曜日より 20% 以上減少しました。...",
  "summary": { "stepCount": 3, "succeededSteps": 3, "failedSteps": 0, "skippedSteps": 0 },
  "error": null,
  "completedAt": "ISO8601"
}

error.type の値

値意味
step_failedいずれかのステップが失敗した。message に失敗したステップと内容が入ります
timed_out実行時間の上限(3 時間)を超えた
not_runnableAutomation の内容に誤りがあり、実行を始められなかった
lease_lost / reaped実行環境との接続が途切れ、実行が打ち切られた
run_failed上記以外の理由で実行が失敗した

呼び出し例

curl 'https://api.squadbase.dev/v0/automation/<PROJECT_ID>/<AUTOMATION_NAME>/executions/<EXECUTION_ID>/result' \
  -H 'x-api-key: <YOUR_API_KEY>'

executionId が存在しない場合や、path の Automation に属していない場合は 422 を返します。詳しくは エラー を参照してください。