Skip to content

Durable Workflow 0.1.0

Workerの永続的なワークフロークラスを利用可能にします。

公開パッケージの内容を取得して検証済みです。

Hostの対応や受け入れ判断は、パッケージの公開とは別です。このバージョンを使う前に、利用先のHostで確認してください。

使い方

トラフィックの重みが付いたすべてのWorkerVersionで、そのクラスをエクスポートする必要があります。ワークフローのインスタンスは実行時のデータです。このFormは実行ごとではなく、ワークフローの能力を表します。

関連するForms: ModuleWorker 0.1.0 · WorkerVersion 0.3.0 · WorkerDeployment 0.2.0

定義の説明(英語原文)

Long-lived identity of one code-defined durable workflow: a class the worker's active deployment serves, whose instances survive process death. The Form fixes the execution model by identity — the worker.workflow@1.0.0 contract in its providedInterfaces states memoized replay, at-least-once step execution, the closed status vocabulary, and the two bounds that keep an instance finite. It carries NO implementation snapshot: which code answers is whatever the worker's active Worker Deployment selects, so behavior upgrades and rollback ride the deployment like any other traffic change. Instances are runtime data reached through module-worker.workflow bindings, never Resources. One worker carries at most one Durable Workflow per class name.

設定項目

項目名とスキーマ内の説明は、パッケージに含まれる英語の原文です。日本語の解説は定義に要件を追加するものではありません。

className

必須 · string

Class export name the serving module provides, in the JavaScript identifier grammar. Every weighted version of the active deployment must export it; one that does not keeps this workflow from becoming Ready, and creating an instance against it is refused rather than queued.

  • pattern: "^[A-Za-z_$][A-Za-z0-9_$]*$"

worker

必須 · object

Module Worker identity whose active deployment serves this workflow class. Changing it replaces the workflow.

  • additionalProperties: false

設定の例

パッケージに含まれるfixtures/desired.jsonをそのまま掲載しています。完全なHost APIリクエストやOpenTofuの設定ではありません。例のリソース参照とArtifactのダイジェストは、実際の値に置き換えてください。このJSONだけでリソースが作成されることはありません。

json
{
  "className": "OrderFulfilment",
  "worker": {
    "apiVersion": "edge.forms.takoform.com",
    "kind": "ModuleWorker",
    "name": "module-worker"
  }
}

例の原文を見る

設定のスキーマ全文(英語原文)

入れ子の項目、選択肢、すべてのスキーマ制約を以下に掲載しています。Hostが検証する意味上の規則は、定義の説明にも記載されています。

json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Long-lived identity of one code-defined durable workflow: a class the worker's active deployment serves, whose instances survive process death. The Form fixes the execution model by identity — the worker.workflow@1.0.0 contract in its providedInterfaces states memoized replay, at-least-once step execution, the closed status vocabulary, and the two bounds that keep an instance finite. It carries NO implementation snapshot: which code answers is whatever the worker's active Worker Deployment selects, so behavior upgrades and rollback ride the deployment like any other traffic change. Instances are runtime data reached through module-worker.workflow bindings, never Resources. One worker carries at most one Durable Workflow per class name.",
  "properties": {
    "className": {
      "description": "Class export name the serving module provides, in the JavaScript identifier grammar. Every weighted version of the active deployment must export it; one that does not keeps this workflow from becoming Ready, and creating an instance against it is refused rather than queued.",
      "pattern": "^[A-Za-z_$][A-Za-z0-9_$]*$",
      "type": "string"
    },
    "worker": {
      "additionalProperties": false,
      "description": "Module Worker identity whose active deployment serves this workflow class. Changing it replaces the workflow.",
      "properties": {
        "apiVersion": {
          "const": "edge.forms.takoform.com",
          "type": "string"
        },
        "kind": {
          "const": "ModuleWorker",
          "type": "string"
        },
        "name": {
          "maxLength": 63,
          "minLength": 1,
          "pattern": "^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$",
          "type": "string"
        }
      },
      "required": [
        "apiVersion",
        "kind",
        "name"
      ],
      "type": "object",
      "x-takoform-required-interface": {
        "apiVersion": "interfaces.takoform.com/v1alpha1",
        "name": "worker.runtime",
        "schemaDigest": "sha256:ed2f8211aac5be94488d391945ca6aca7627a4ecbd261e39790093e887feae08",
        "version": "1.1.0"
      }
    }
  },
  "required": [
    "className",
    "worker"
  ],
  "title": "Durable Workflow desired state",
  "type": "object"
}

ライフサイクル

役割: identity

  • create
  • read
  • delete
  • import
  • observe

提供するInterface

  • worker.workflow@1.0.0sha256:6b652dd311975da84469a5ec44f48acbc6db2097d1473988bd5424a85fda4294

パッケージ参照

項目
KindDurableWorkflow
Package digestsha256:016ec7ec8a1a8333ab6d6aa63e4eb450fc2df47fca06e262a56cc064171d04d1
Schema digestsha256:eed7a1b971e3261df6bc4bafcdfa2fd67e7928f4ec66737d0134df383e7dfc0a
Tagforms/k-mvsgozjomzxxe3ltfz2gc23pmzxxe3jomnxw2l2eovzgcytmmvlw64tlmzwg65y/sha256-016ec7ec8a1a8333ab6d6aa63e4eb450fc2df47fca06e262a56cc064171d04d1
Source pathforms/releases/k-mvsgozjomzxxe3ltfz2gc23pmzxxe3jomnxw2l2eovzgcytmmvlw64tlmzwg65y/sha256-016ec7ec8a1a8333ab6d6aa63e4eb450fc2df47fca06e262a56cc064171d04d1
署名セットe7f8a39311dd011b8467e97e7f300cabb9a6b06c

変更不可のパッケージを開く

4項目のFormRef
json
{
  "apiVersion": "edge.forms.takoform.com",
  "kind": "DurableWorkflow",
  "definitionVersion": "0.1.0",
  "schemaDigest": "sha256:eed7a1b971e3261df6bc4bafcdfa2fd67e7928f4ec66737d0134df383e7dfc0a"
}