Work Orders
Work orders are requests for AgentGate to perform automated tasks. Each work order specifies what to do, where to do it, and how to handle the results.What Is a Work Order
A work order is your instruction to AgentGate. Think of it like a detailed task assignment:- Task Prompt: What you want accomplished
- Workspace Source: Where to do the work
- Configuration: How to customize behavior
- Tenant Context: Who this is for (in B2B2C scenarios)
Work Order Components
Task Prompt
The task prompt describes what you want AgentGate to accomplish. This is the most important part of your work order.- Clear description of the task
- Specific files or areas to focus on
- Coding standards or patterns to follow
- Expected outcome or acceptance criteria
Workspace Source
The workspace source defines where AgentGate should perform the work:- Git Repository
- Template
- URL
Clone from a Git repository:
Configuration Options
Customize how your work order executes:| Option | Type | Description |
|---|---|---|
maxIterations | number | Maximum iteration attempts (default: 10) |
gatePlan | string | Verification level configuration |
webhookUrl | string | URL for completion notification |
metadata | object | Custom key-value data |
Work Order Lifecycle
1
Submission
You submit the work order via API. AgentGate validates the request.
2
Validation
AgentGate checks the workspace source is accessible and the request is well-formed.
3
Queuing
A run is created and queued for execution.
4
Execution
The run executes, iterating until completion or limit reached.
5
Completion
Results are available and webhooks are fired.
Response Structure
When you create a work order, you receive:| Field | Description |
|---|---|
workOrderId | Unique identifier for the work order |
runId | Unique identifier for the created run |
status | Initial status (always pending) |
createdAt | Timestamp of creation |
Best Practices
Writing Effective Task Prompts
Be Specific
Be Specific
Instead of “fix the bug”, say “fix the null pointer exception in UserService.getUser() that occurs when the user ID doesn’t exist in the database”.
Provide Context
Provide Context
Include relevant background: “This is a Node.js Express API using TypeScript. We follow the repository pattern for data access.”
Define Acceptance Criteria
Define Acceptance Criteria
State what success looks like: “The function should return an empty array instead of throwing an error when no results are found.”
Specify Constraints
Specify Constraints
Mention limitations: “Do not modify the database schema. Use existing utility functions where available.”
Choosing Workspace Sources
- Git repositories: Best for existing projects with history
- Templates: Best for new projects or standardized setups
- URLs: Best for one-off tasks or external sources