- Add migration for task metadata column (00003) - Update workflow model and service with metadata support - Update database layer (models, queries) for metadata field - Update storage store to handle metadata - Update roadmap documents and milestones
39 lines
1.1 KiB
Go
39 lines
1.1 KiB
Go
package workflow
|
|
|
|
import "encoding/json"
|
|
|
|
type TaskStatus string
|
|
|
|
const (
|
|
StatusPending TaskStatus = "pending"
|
|
StatusQueued TaskStatus = "queued"
|
|
StatusRunning TaskStatus = "running"
|
|
StatusCompleted TaskStatus = "completed"
|
|
StatusFailed TaskStatus = "failed"
|
|
StatusCanceled TaskStatus = "canceled"
|
|
)
|
|
|
|
type CreateTaskInput struct {
|
|
Title string `json:"title"`
|
|
Source string `json:"source"`
|
|
Payload json.RawMessage `json:"payload"`
|
|
Metadata json.RawMessage `json:"metadata,omitempty"`
|
|
External *ExternalRefInput `json:"external,omitempty"`
|
|
}
|
|
|
|
type ExternalRefInput struct {
|
|
Provider string `json:"provider"`
|
|
ID string `json:"id"`
|
|
URL string `json:"url"`
|
|
Metadata json.RawMessage `json:"metadata"`
|
|
}
|
|
|
|
const (
|
|
MetadataKeyAgentRunState = "agent_run_state"
|
|
MetadataKeyAgentPhase = "agent_phase"
|
|
MetadataKeyWaitType = "wait_type"
|
|
MetadataKeyStatusReason = "status_reason"
|
|
MetadataKeyLastHeartbeat = "last_heartbeat_at"
|
|
MetadataKeyPlanRef = "plan_ref"
|
|
MetadataKeyAttempt = "attempt"
|
|
)
|