Agent Workflows
An agent is only as capable as the workflow that drives it. A workflow defines the exact sequence of steps an agent follows when it picks up a work item — from reading the task description to opening a pull request and requesting review.
How agent workflows differ from regular workflows
Any workflow can power an agent, but agent-focused workflows typically start with a Work Item Trigger and spend most of their time in Action nodes that interact with git and AI services. They often include Decision nodes that pause execution for human review before critical steps such as merging code.
The plan-code-review-PR pattern
The most common pattern for agent workflows follows four stages:
1. Plan The agent reads the work item description and asks an AI model to produce an implementation plan. The plan is saved as a workflow variable and, optionally, posted back to the work item as a comment for team visibility.
2. Code Using the plan as context, the agent prompts the AI model to generate or modify code. File write nodes apply the changes to the linked repository's working branch.
3. Review A Decision node pauses the workflow and notifies the assignee (a human) that code is ready for review. The agent resumes only after the reviewer approves, requests changes, or leaves feedback.
4. PR Once approved, the workflow commits the changes to the branch and opens a pull request against the target branch. The work item status is updated to reflect the new state.
Building an agent workflow
- Go to your project's Workflows section and create a new workflow.
- Add a Work Item Trigger as the starting node.
- Connect Action nodes for your AI calls, file operations, and git commands.
- Add a Pause for Review Decision node anywhere you want a human checkpoint.
- End with a Done node on the success path and an Error Exit node on failure paths.
- Save the workflow and attach it to work items via the Workflow Template field.
Common action nodes for agents
- AI Prompt — Send a prompt to Claude and capture the response
- Git Commit — Commit staged changes to the work item's linked repository
- Create Pull Request — Open a PR on the configured repository
- Update Work Item — Change the status, priority, or other fields on the triggering work item
- Add Comment — Post a message to the work item's activity log
Tips for reliable agent workflows
- Always handle the error path from every Action node to avoid silent failures.
- Use variables to pass the AI's plan into later prompt nodes so the agent stays on track.
- Keep the initial prompt focused: provide the work item title, description, and any relevant metadata as context.
- Use the Pause for Review node before any destructive or irreversible action.
Next steps
- Node Library — Full list of available nodes
- Triggers — Learn about the Work Item Trigger
- AI Assistant — Interactive AI chat without a full workflow