archastro.platform.types.workflows
1# Copyright (c) 2026 ArchAstro Inc. Licensed under the MIT License. 2# This file is auto-generated by @archastro/sdk-generator. Do not edit. 3# Content hash: 441c73648dc4 4 5from datetime import datetime 6from typing import Any 7 8from pydantic import BaseModel, Field 9 10 11class WorkflowJournalEntry(BaseModel): 12 """ 13 One ordered, replayable record from a durable workflow journal. 14 """ 15 16 command_id: str | None = Field( 17 default=None, 18 description="Durable command identifier associated with the record, when present.", 19 ) 20 created_at: datetime | None = Field( 21 default=None, description="When this entry was durably committed." 22 ) 23 id: str = Field(..., description="Journal entry ID (`wdr_...`).") 24 node_id: str | None = Field( 25 default=None, 26 description="Workflow node associated with the record. `null` for execution-level records.", 27 ) 28 record: dict[str, Any] = Field( 29 ..., 30 description="Replayable workflow record body, including payload, context, environment, metadata, and timestamp.", 31 ) 32 sequence: int = Field(..., description="Monotonically increasing sequence within the journal.") 33 timer_id: str | None = Field( 34 default=None, 35 description="Durable timer identifier associated with the record, when present.", 36 ) 37 type: str = Field( 38 ..., 39 description="Workflow record type, such as `node_started`, `node_completed`, or `node_failed`.", 40 ) 41 42 43class WorkflowJournal(BaseModel): 44 """ 45 Summary of the durable workflow execution journal associated with a run. 46 """ 47 48 completed_at: datetime | None = Field( 49 default=None, 50 description="When durable workflow execution reached a terminal state. `null` while it is active.", 51 ) 52 created_at: datetime | None = Field(default=None, description="When the journal was created.") 53 current_sequence: int = Field( 54 ..., description="Highest workflow record sequence durably committed to this journal." 55 ) 56 id: str = Field(..., description="Journal execution ID (`wde_...`).") 57 started_at: datetime | None = Field( 58 default=None, description="When durable workflow execution started." 59 ) 60 status: str = Field( 61 ..., 62 description="Current durable execution status: `pending`, `running`, `waiting`, `completed`, `failed`, or `cancelled`.", 63 ) 64 updated_at: datetime | None = Field( 65 default=None, description="When the journal was last updated." 66 ) 67 68 69class WorkflowWorkItem(BaseModel): 70 """ 71 Externally executable work yielded by a durable workflow. 72 """ 73 74 agent: str = Field(..., description="Agent assigned to execute this work.") 75 attempt_count: int = Field( 76 ..., description="Number of times this work has been freshly claimed or reclaimed." 77 ) 78 command_id: str = Field( 79 ..., description="Opaque journal command identity used to resume the workflow exactly once." 80 ) 81 created_at: datetime 82 execution: str = Field(..., description="Durable workflow execution that owns this work.") 83 id: str = Field(..., description="Work item ID (`wdi_...`).") 84 lease_expires_at: datetime | None = Field( 85 default=None, 86 description="When the current claim expires. Null for queued or terminal work.", 87 ) 88 node_id: str = Field(..., description="Workflow graph node that yielded the work.") 89 payload: dict[str, Any] = Field( 90 ..., description="Instructions and participant bindings needed to execute the work." 91 ) 92 routine_run: str | None = Field( 93 default=None, 94 description="Routine run that owns the execution, when this work came from a routine.", 95 ) 96 status: str = Field(..., description="Current queue lifecycle status.") 97 type: str = Field( 98 ..., description="Stable resource discriminator. Always `workflow_work_item`." 99 ) 100 updated_at: datetime 101 102 103class WorkflowWorkItemLease(BaseModel): 104 """ 105 A claimed workflow work item and its caller-held lease token. 106 """ 107 108 lease_owner: str = Field( 109 ..., 110 description="Opaque lease token that must be persisted and presented for later transitions.", 111 ) 112 work_item: WorkflowWorkItem = Field( 113 ..., description="The claimed, resumed, started, or heartbeated work item." 114 ) 115 116 117class WorkflowWorkItemClaim(BaseModel): 118 """ 119 Result of polling an agent's durable workflow work queue. 120 """ 121 122 data: WorkflowWorkItemLease | None = Field( 123 default=None, 124 description="Claimed or resumed work and its lease; null when no eligible item exists.", 125 ) 126 127 128class WorkflowWorkItemList(BaseModel): 129 """ 130 Active durable workflow work available to the viewer. 131 """ 132 133 after_cursor: str | None = Field( 134 default=None, description="Opaque cursor for the next page, or null at the end." 135 ) 136 before_cursor: str | None = Field( 137 default=None, description="Always null because queue pagination is forward-only." 138 ) 139 data: list[WorkflowWorkItem] = Field( 140 ..., 141 description="Active work items. Lease tokens are intentionally never included in list responses.", 142 ) 143 has_more: bool = Field(..., description="Whether another page of work exists.")
12class WorkflowJournalEntry(BaseModel): 13 """ 14 One ordered, replayable record from a durable workflow journal. 15 """ 16 17 command_id: str | None = Field( 18 default=None, 19 description="Durable command identifier associated with the record, when present.", 20 ) 21 created_at: datetime | None = Field( 22 default=None, description="When this entry was durably committed." 23 ) 24 id: str = Field(..., description="Journal entry ID (`wdr_...`).") 25 node_id: str | None = Field( 26 default=None, 27 description="Workflow node associated with the record. `null` for execution-level records.", 28 ) 29 record: dict[str, Any] = Field( 30 ..., 31 description="Replayable workflow record body, including payload, context, environment, metadata, and timestamp.", 32 ) 33 sequence: int = Field(..., description="Monotonically increasing sequence within the journal.") 34 timer_id: str | None = Field( 35 default=None, 36 description="Durable timer identifier associated with the record, when present.", 37 ) 38 type: str = Field( 39 ..., 40 description="Workflow record type, such as `node_started`, `node_completed`, or `node_failed`.", 41 )
One ordered, replayable record from a durable workflow journal.
Workflow node associated with the record. null for execution-level records.
44class WorkflowJournal(BaseModel): 45 """ 46 Summary of the durable workflow execution journal associated with a run. 47 """ 48 49 completed_at: datetime | None = Field( 50 default=None, 51 description="When durable workflow execution reached a terminal state. `null` while it is active.", 52 ) 53 created_at: datetime | None = Field(default=None, description="When the journal was created.") 54 current_sequence: int = Field( 55 ..., description="Highest workflow record sequence durably committed to this journal." 56 ) 57 id: str = Field(..., description="Journal execution ID (`wde_...`).") 58 started_at: datetime | None = Field( 59 default=None, description="When durable workflow execution started." 60 ) 61 status: str = Field( 62 ..., 63 description="Current durable execution status: `pending`, `running`, `waiting`, `completed`, `failed`, or `cancelled`.", 64 ) 65 updated_at: datetime | None = Field( 66 default=None, description="When the journal was last updated." 67 )
Summary of the durable workflow execution journal associated with a run.
When durable workflow execution reached a terminal state. null while it is active.
Highest workflow record sequence durably committed to this journal.
70class WorkflowWorkItem(BaseModel): 71 """ 72 Externally executable work yielded by a durable workflow. 73 """ 74 75 agent: str = Field(..., description="Agent assigned to execute this work.") 76 attempt_count: int = Field( 77 ..., description="Number of times this work has been freshly claimed or reclaimed." 78 ) 79 command_id: str = Field( 80 ..., description="Opaque journal command identity used to resume the workflow exactly once." 81 ) 82 created_at: datetime 83 execution: str = Field(..., description="Durable workflow execution that owns this work.") 84 id: str = Field(..., description="Work item ID (`wdi_...`).") 85 lease_expires_at: datetime | None = Field( 86 default=None, 87 description="When the current claim expires. Null for queued or terminal work.", 88 ) 89 node_id: str = Field(..., description="Workflow graph node that yielded the work.") 90 payload: dict[str, Any] = Field( 91 ..., description="Instructions and participant bindings needed to execute the work." 92 ) 93 routine_run: str | None = Field( 94 default=None, 95 description="Routine run that owns the execution, when this work came from a routine.", 96 ) 97 status: str = Field(..., description="Current queue lifecycle status.") 98 type: str = Field( 99 ..., description="Stable resource discriminator. Always `workflow_work_item`." 100 ) 101 updated_at: datetime
Externally executable work yielded by a durable workflow.
Number of times this work has been freshly claimed or reclaimed.
Opaque journal command identity used to resume the workflow exactly once.
When the current claim expires. Null for queued or terminal work.
Instructions and participant bindings needed to execute the work.
104class WorkflowWorkItemLease(BaseModel): 105 """ 106 A claimed workflow work item and its caller-held lease token. 107 """ 108 109 lease_owner: str = Field( 110 ..., 111 description="Opaque lease token that must be persisted and presented for later transitions.", 112 ) 113 work_item: WorkflowWorkItem = Field( 114 ..., description="The claimed, resumed, started, or heartbeated work item." 115 )
A claimed workflow work item and its caller-held lease token.
Opaque lease token that must be persisted and presented for later transitions.
118class WorkflowWorkItemClaim(BaseModel): 119 """ 120 Result of polling an agent's durable workflow work queue. 121 """ 122 123 data: WorkflowWorkItemLease | None = Field( 124 default=None, 125 description="Claimed or resumed work and its lease; null when no eligible item exists.", 126 )
Result of polling an agent's durable workflow work queue.
129class WorkflowWorkItemList(BaseModel): 130 """ 131 Active durable workflow work available to the viewer. 132 """ 133 134 after_cursor: str | None = Field( 135 default=None, description="Opaque cursor for the next page, or null at the end." 136 ) 137 before_cursor: str | None = Field( 138 default=None, description="Always null because queue pagination is forward-only." 139 ) 140 data: list[WorkflowWorkItem] = Field( 141 ..., 142 description="Active work items. Lease tokens are intentionally never included in list responses.", 143 ) 144 has_more: bool = Field(..., description="Whether another page of work exists.")
Active durable workflow work available to the viewer.