コンテンツにスキップ
HaneDOCSEN

API リファレンス

Workflow

案件・待機と再開・スケジュール・イベントの購読と webhook。

案件(Case)・待機と再開、スケジュール、イベントの購読と webhook の配信

説明は公開 API の契約(OpenAPI)から生成しています。

GET /v1/workflows/cases
GET /v1/workflows/outcomes
GET /v1/workflows/cases/{id}
POST /v1/workflows/cases/{id}/cancel
POST /v1/workflows/cases/{id}/retry
POST /v1/workflows/cases/{id}/restart
GET /v1/workflows/definitions
GET /v1/workflows/schedules
POST /v1/workflows/schedules/{name}/trigger
POST /v1/workflows/schedules/{name}/pause
POST /v1/workflows/schedules/{name}/resume
GET /v1/workflows/event-subscriptions
POST /v1/workflows/event-subscriptions
GET /v1/workflows/event-subscriptions/{id}
PATCH /v1/workflows/event-subscriptions/{id}
DELETE /v1/workflows/event-subscriptions/{id}
POST /v1/workflows/event-subscriptions/{id}/rotate-secret
POST /v1/workflows/event-subscriptions/{id}/resume
GET /v1/workflows/event-subscriptions/{id}/deliveries
GET /v1/workflows/event-subscriptions/{id}/deliveries/{delivery}

GET/v1/workflows/cases

名前 場所 型 必須 説明
status query CaseStatus
workflow query string
subject_id query string
business_key query string
limit query integer
  • 200 — object: Case
  • default — Problem: RFC 9457 Problem Details

GET/v1/workflows/outcomes

workflows:read が必要。案件が完了条件に達した成果。同じ案件の同じ完了条件の成果は 1 件だけで、 完了のイベントが届き直しても増えない。新しいものから返す

名前 場所 型 必須 説明
case_id query string
workflow query string
limit query integer
cursor query string 前のページの next_cursor
  • 200 — object: 成果
  • default — Problem: RFC 9457 Problem Details

GET/v1/workflows/cases/{id}

名前 場所 型 必須 説明
id path string はい
  • 200 — object: Case と経過と待機と、Case が動いている Workflow の定義
  • default — Problem: RFC 9457 Problem Details

POST/v1/workflows/cases/{id}/cancel

名前 場所 型 必須 説明
id path string はい
Idempotency-Key header string 副作用を伴う POST ではサーバーが必須にする。SDK は無ければ自動で付けるので、型では省略できる

application/json

名前 型 必須 説明
reason string はい
  • 200 — Case: Case
  • default — Problem: RFC 9457 Problem Details

POST/v1/workflows/cases/{id}/retry

名前 場所 型 必須 説明
id path string はい
Idempotency-Key header string 副作用を伴う POST ではサーバーが必須にする。SDK は無ければ自動で付けるので、型では省略できる
  • 200 — Case: Case
  • default — Problem: RFC 9457 Problem Details

POST/v1/workflows/cases/{id}/restart

workflows:operate が必要。有効なバージョンで始め直す。今の案件(実行中・待機中・失敗)を取り消し、同じ Workflow と 対象のレコードで、いまの有効な ReleaseBundle の案件を始めて返す。今の案件の定義は書き換えない。今の案件がすでに 有効なバージョンで動いているとき、有効なバージョンにその Workflow がないときは CONFLICT

名前 場所 型 必須 説明
id path string はい
Idempotency-Key header string 副作用を伴う POST ではサーバーが必須にする。SDK は無ければ自動で付けるので、型では省略できる
  • 200 — Case: 始めた案件
  • default — Problem: RFC 9457 Problem Details

GET/v1/workflows/definitions

  • 200 — object: 有効なバージョンの Workflow
  • default — Problem: RFC 9457 Problem Details

GET/v1/workflows/schedules

  • 200 — object: スケジュール
  • default — Problem: RFC 9457 Problem Details

POST/v1/workflows/schedules/{name}/trigger

手動で発火する(発火の日は今日)

名前 場所 型 必須 説明
name path string はい
Idempotency-Key header string 副作用を伴う POST ではサーバーが必須にする。SDK は無ければ自動で付けるので、型では省略できる
  • 200 — ScheduleRun: 発火の結果
  • default — Problem: RFC 9457 Problem Details

POST/v1/workflows/schedules/{name}/pause

名前 場所 型 必須 説明
name path string はい
Idempotency-Key header string 副作用を伴う POST ではサーバーが必須にする。SDK は無ければ自動で付けるので、型では省略できる
  • 200 — Schedule: スケジュール
  • default — Problem: RFC 9457 Problem Details

POST/v1/workflows/schedules/{name}/resume

名前 場所 型 必須 説明
name path string はい
Idempotency-Key header string 副作用を伴う POST ではサーバーが必須にする。SDK は無ければ自動で付けるので、型では省略できる
  • 200 — Schedule: スケジュール
  • default — Problem: RFC 9457 Problem Details

GET/v1/workflows/event-subscriptions

workflows:read が必要。プロジェクトと環境の、消していない購読の一覧。一時停止しているものも含む

  • 200 — object: 購読の一覧
  • default — Problem: RFC 9457 Problem Details

POST/v1/workflows/event-subscriptions

workflows:event-subscriptions.manage が必要。イベントを webhook で届ける購読を登録する。 宛先は HTTPS の公開された DNS の名前だけ。署名の秘密値はこの応答でしか返さない。同じ名前の消していない購読があれば 409 にする。 Idempotency-Key は使わない(応答に秘密値を含むので保存しない)。監査が止まっている間は 503 にする

application/json — EventSubscriptionInput

名前 型 必須 説明
name string はい プロジェクトの中で一意な名前
url string はい 配信の宛先。HTTPS の公開された DNS の名前だけ
event_types PublishedEventType[] はい
  • 201 — object: 登録した購読と署名の秘密値
  • default — Problem: RFC 9457 Problem Details

GET/v1/workflows/event-subscriptions/{id}

workflows:read が必要

名前 場所 型 必須 説明
id path string はい
  • 200 — EventSubscription: 購読
  • default — Problem: RFC 9457 Problem Details

PATCH/v1/workflows/event-subscriptions/{id}

workflows:event-subscriptions.manage が必要。宛先と type を変える。名前と署名の秘密値は変えない。 終わっていない配信は新しい宛先へ送り、type を外しても変える前に作った配信は届ける。宛先を変えると失敗の数を数え直す。 If-Match が要る。監査が止まっている間は 503 にする

名前 場所 型 必須 説明
id path string はい
If-Match header string はい 取得したときの ETag(version)

application/json — EventSubscriptionChange

名前 型 必須 説明
url string 配信の宛先。HTTPS の公開された DNS の名前だけ
event_types PublishedEventType[]
  • 200 — EventSubscription: 変えた購読
  • default — Problem: RFC 9457 Problem Details

DELETE/v1/workflows/event-subscriptions/{id}

workflows:event-subscriptions.manage が必要。購読を消し、終わっていない配信を取り消し、署名の秘密値を消す。 配信の記録は保持の日数まで読める

名前 場所 型 必須 説明
id path string はい
  • 204: 消した
  • default — Problem: RFC 9457 Problem Details

POST/v1/workflows/event-subscriptions/{id}/rotate-secret

workflows:event-subscriptions.manage が必要。署名の秘密値を替え、新しい値を返す。24 時間は新旧 2 つの値で署名するので (webhook-signature に空白で区切って並べる)、受け手はその間に新しい値へ移る。その間にまた回すと、いちばん古い値はすぐに消える。 Idempotency-Key は使わない(応答に秘密値を含むので保存しない)

名前 場所 型 必須 説明
id path string はい

application/json

  • 200 — object: 新しい署名の秘密値
  • default — Problem: RFC 9457 Problem Details

POST/v1/workflows/event-subscriptions/{id}/resume

workflows:event-subscriptions.manage が必要。一時停止した購読を再開する。再開を待つ配信と、受け手が失敗し始めてから届かなかった配信を、 同じ webhook-id で少しずつ送り直す。止まっていなければ何も変えない。監査が止まっている間は 503 にする

名前 場所 型 必須 説明
id path string はい

application/json

  • 200 — EventSubscription: 再開した購読
  • default — Problem: RFC 9457 Problem Details

GET/v1/workflows/event-subscriptions/{id}/deliveries

workflows:read が必要。購読の配信の記録を新しい順に返す。購読を消した後も保持の日数まで読める

名前 場所 型 必須 説明
id path string はい
limit query integer
cursor query string
  • 200 — object: 配信の記録
  • default — Problem: RFC 9457 Problem Details

GET/v1/workflows/event-subscriptions/{id}/deliveries/{delivery}

workflows:read が必要。配信の記録と、送るたびの結果。受け手の応答の本文は残さない。 再送の回数を使い切った配信は、/v1/audit/dead-letters の入れ直しでもう一度送る

名前 場所 型 必須 説明
id path string はい
delivery path string はい
  • 200 — object: 配信の記録
  • default — Problem: RFC 9457 Problem Details