Add CodeDefinition, SignalDefinition, QueryDefinition, UpdateDefinition types for workflow interface metadata. Update Registration struct with DeploymentID, Definition, and CompatibleWithChatAssistant fields. Deprecate TaskQueue in favor of DeploymentID. BREAKING CHANGE: Remove GetWorkflowWorkerInfo and workflow.WorkerInfo — the /v1/workflows/workers/whoami endpoint was removed upstream.
37 lines
1.5 KiB
Go
37 lines
1.5 KiB
Go
package workflow
|
|
|
|
// CodeDefinition describes a workflow's code-level interface: its input/output
|
|
// schemas, signal/query/update handlers, and execution constraints.
|
|
type CodeDefinition struct {
|
|
InputSchema map[string]any `json:"input_schema"`
|
|
OutputSchema map[string]any `json:"output_schema,omitempty"`
|
|
Signals []SignalDefinition `json:"signals,omitempty"`
|
|
Queries []QueryDefinition `json:"queries,omitempty"`
|
|
Updates []UpdateDefinition `json:"updates,omitempty"`
|
|
EnforceDeterminism bool `json:"enforce_determinism,omitempty"`
|
|
ExecutionTimeout *float64 `json:"execution_timeout,omitempty"`
|
|
}
|
|
|
|
// SignalDefinition describes a signal handler on a workflow.
|
|
type SignalDefinition struct {
|
|
Name string `json:"name"`
|
|
InputSchema map[string]any `json:"input_schema"`
|
|
Description *string `json:"description,omitempty"`
|
|
}
|
|
|
|
// QueryDefinition describes a query handler on a workflow.
|
|
type QueryDefinition struct {
|
|
Name string `json:"name"`
|
|
InputSchema map[string]any `json:"input_schema"`
|
|
Description *string `json:"description,omitempty"`
|
|
OutputSchema map[string]any `json:"output_schema,omitempty"`
|
|
}
|
|
|
|
// UpdateDefinition describes an update handler on a workflow.
|
|
type UpdateDefinition struct {
|
|
Name string `json:"name"`
|
|
InputSchema map[string]any `json:"input_schema"`
|
|
Description *string `json:"description,omitempty"`
|
|
OutputSchema map[string]any `json:"output_schema,omitempty"`
|
|
}
|