Automatic jest test generation for GitHub PRs with dual AI review
Needs changesWhat this workflow does
This AI workflow has 20 nodes and runs when an HTTP GET request hits its webhook URL. Along the way it connects GitHub and OpenAI Chat Model.
How it runs
Trigger: When an HTTP GET request hits its webhook URL.
- Extrat API URL, owner and repo (Code): runs custom JavaScript code
- GET .diff file (HTTP Request): calls an HTTP API
- Merge: merges the data from its input branches
- Merge: merges the data from its input branches
- Splits text into array (Code): runs custom JavaScript code
- Get File name (Code): runs custom JavaScript code
- Prepare for POST (Code): runs custom JavaScript code
- FIlter for components (Code): runs custom JavaScript code
- Test Maker (AI Agent): runs an AI agent, with model: o3-mini; 2 tools (Get Repo, Get Files); output parser: Structured Output Parser
- POST Comments (HTTP Request): calls an HTTP API
…plus 3 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in Test Maker (v1.8), Code Reviewer (v1.8): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) Test Maker (v1.8), Code Reviewer (v1.8) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (9)
- GitHub
n8n-nodes-base.github - HTTP Request
n8n-nodes-base.httpRequest - Code
n8n-nodes-base.code - Github Tool
n8n-nodes-base.githubTool - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Merge
n8n-nodes-base.merge - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Webhook
n8n-nodes-base.webhook
From the author
Workflow: Automatic Unit Test Creator from GitHub 🏗️ Architecture Overview This workflow listens for GitHub pull-request events, analyzes changed React/TypeScript files, auto-generates Jest tests via AI, has them reviewed by a second AI pass, and posts…