AiTask
Type: Object
Represents a single, executable step within an AI-driven workflow. When an AI 'Execution' (a running process) begins, it generates a series of these tasks from a predefined template. Each task is a concrete action to be performed, such as 'Analyze customer artwork for preflight errors,' 'Calculate ink consumption for job #12345,' or 'Dispatch shipping notification.' This resource tracks the lifecycle of that action—from pending to in-progress, completed, or failed. It's the fundamental unit of work in the AI system, providing granular visibility and control over the automated processes that drive the print facility.
Fields
| Name | Type | Args | Description | Deprecated |
|---|---|---|---|---|
| agent | AiAgent! | |||
| agentId | ID! | |||
| completedAt | DateTime | When the task completed (successfully or with failure) | ||
| context | String | Additional context for the task | ||
| createdAt | DateTime! | When the task was created | ||
| dependencies | [AiTask!]! | filter: AiTaskFilterInputlimit: Intoffset: Intsort: [AiTaskSortInput] | ||
| description | String! | Interpolated description with actual values from the execution input | ||
| errorMessage | String | Error message if the task failed | ||
| execution | AiExecution! | |||
| executionId | ID! | |||
| expectedOutput | String | Description of what output is expected from this task | ||
| id | ID! | |||
| metadata | JsonString | Additional metadata for the task | ||
| outputJsonSchema | JsonString | JSON Schema for structured output. When provided, the LLM will use JSON mode with this schema to ensure valid JSON output | ||
| priority | Int | Task priority (higher numbers = higher priority) | ||
| result | String | The output produced by the agent | ||
| startedAt | DateTime | When the task started execution | ||
| state | String! | The current state of the task: pending, assigned, in_progress, completed, failed, or cancelled | ||
| taskTemplate | AiTaskTemplate | The template this task was created from | ||
| taskTemplateId | ID | |||
| updatedAt | DateTime! | When the task was last updated |