- Listens for new pull requests
- Clones the relevant repository and branch
- Prepares a structured review plan
- Executes inline code review using autonomous agents
Understanding Agent Actions: This workflow demonstrates both
agent.run
(for focused planning) and agent.session
(for complex coordination). To learn more about when to use each action type, see our Agent Differences guide.Create a New Use Case
1
Open the Use Cases page
In the sidebar, click
Use Cases
, then select Create Use Case
.2
Name your Use Case
Give it a clear name like
Code Review
.Set up the PR Trigger
1
Edit the Trigger block
The Use Case starts with a default trigger. Click the trigger node to open its settings.
2
Select PR Opened
Choose the
PR Opened
trigger type. This ensures the workflow is activated any time a pull request is opened in the connected repo.Add the Clone Repo Action
1
Add the Clone Repo block
Drag
Clone Repo
from the left sidebar and connect it to the PR Opened block.2
Select the Git Organization
Choose your organization from the dropdown list of connected GitHub organizations.
3
Select the Repository
Use a dynamic value to select the repository to clone.
{{trigger.repository.name}}
.4
Select the Branch
Use a dynamic value to select the branch of the PR.
{{trigger.pullRequest.headBranch}}
.Add a Review Planning Step
The first agent in the flow acts as a Code Review Planner. It inspects the diff and identifies which parts of the code need focused review. We are using theagent.run
action to execute a single agent for this focused task.
1
Add the Prepare Review Plan block
Drag
agent.run
onto the canvas and connect it after Clone Repo
.2
Select the Planner Agent
Assign the
Senior Developer
agent to this step.You may use other agent personas to perform the planning, based on your setup.
3
Write the planning instructions
Use the following prompt:
Why
agent.run
for planning? The review planning step is a focused, single-purpose task that can be completed by one agent without coordination. This makes agent.run
perfect for generating the initial review plan.Add the Code Review Step
The second step in the process performs the actual code review based on the tasks defined in the planning stage. We are using theagent.session
action to coordinate multiple agents for this complex, multi-step review process.
1
Add the Code Review block
Drag
agent.session
onto the canvas and connect it to Prepare Review Plan
node.2
Set the step ID
Set the step ID to
prepareReviewPlan
.The step ID is used to reference the output of this step in the prompt of the next step.
3
Assign the Reviewer Agent
Select at least the
Code Reviewer Agent
and/or other agent personas to perform the review.It is critical to use at least one agent persona that is based on the Code Reviewer built-in agent persona.
You can add a developer persona with tools to create and edit code, and it will be able to response for requests from the user to fix issues found in the code review.
4
Configure the instructions
Use the following prompt. Note the
review items
variable at the bottom of the prompt, it is a dynamic value with the output of the Prepare Review Plan
node.Test the Workflow
1
Open a pull request
Trigger the workflow by creating a new pull request in the selected repository.
2
Monitor the execution
Go to the
Executions
tab to see the step-by-step progress. You should see the repo cloned, the review plan created, and comments posted on the PR.The agent-generated comments will appear directly in the pull request timeline, just like those made by a human reviewer.
Expand the Flow
1
Reply on a review comment
After Overcut posts a review comment, you can reply to it in the pull request timeline, and ask Overcut to fix the issue.
✅ Success Checklist
- Workflow triggers when a PR is opened
- Code is cloned from the correct branch
- Review plan is generated with task-level breakdowns
- Code Reviewer Agent posts inline comments to the PR
Next Steps
Now that you’ve built a code review workflow, explore these related topics:- Agent Run Action: Learn more about single-agent execution
- Agent Session Action: Understand multi-agent coordination
- Git Clone Action: Configure repository cloning options
- Repository Mapping: Set up automatic repository identification