Review Terraform pull requests with GitHub, GPT-4.1, Postgres and Slack
Needs changesWhat this workflow does
This AI workflow has 20 nodes and runs on Github events (pull request). Along the way it connects GitHub, HTTP Request, Vector Store Question Answer and OpenAI Chat Model and 2 more.
How it runs
Trigger: On Github events (pull request).
- Set - Config (Edit Fields (Set)): sets 7 fields: prNumber, repoOwner, repoName…
- Get - PR Diff (GitHub): get (pull request)
- AI Agent: runs an AI agent, with model: OpenAI Chat Model; 4 tools (Tool - Run Security Scan, Tool - Run Terraform Plan, Tool - Estimate Cost Impact, Tool - RAG Search IaC Standards); memory: Window Buffer Memory
- Set - Parse Agent Output (Edit Fields (Set)): sets 1 field: parsedOutput
- Postgres: uses Postgres
- GitHub: create comment
- If: checks a condition and branches into true / false
- GitHub: work with review
- Slack: uses Slack
- Wait: pauses before continuing
…plus 3 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
2 things in this workflow are removed in n8n 3.0. Fix them before you upgrade:
- HTTP Request Tool (legacy) in Tool - Run Terraform Plan, Tool - Run Security Scan, Tool - Estimate Cost Impact: replace with HTTP Request node connected to the AI Agent's Tool input.
- AI Agent v1 (old agent modes) in AI Agent - Terraform Reviewer (v1.6): 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 |
|---|---|
| HTTP Request Tool (legacy) Tool - Run Terraform Plan, Tool - Run Security Scan, Tool - Estimate Cost Impact | HTTP Request node connected to the AI Agent's Tool input |
| AI Agent v1 (old agent modes) AI Agent - Terraform Reviewer (v1.6) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (12)
- Github Trigger
n8n-nodes-base.githubTrigger - Edit Fields (Set)
n8n-nodes-base.set - GitHub
n8n-nodes-base.github - HTTP Request Tool
@n8n/n8n-nodes-langchain.toolHttpRequest - Vector Store Question Answer Tool
@n8n/n8n-nodes-langchain.toolVectorStore - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - AI Agent
@n8n/n8n-nodes-langchain.agent - Postgres
n8n-nodes-base.postgres - If
n8n-nodes-base.if - Slack
n8n-nodes-base.slack - Wait
n8n-nodes-base.wait
From the author
Quick overview This workflow reviews Terraform pull requests in GitHub using an OpenAI tool-calling agent that can run plan, security, cost, and standards checks, then logs results to Postgres, comments on the PR, and auto-approves clean changes or routes…