n8n

How to Automate OpenAI Content Approvals?

Use a single intake to draft, review, and approve content with AI and a human check. Teams send a POST request and get a clear draft that is reviewed, approved, and stored. It fits groups that publish handbooks, guides, or marketing notes.

Here is how it works. A webhook on POST pyragogy/process receives the request, then a quick database query confirms the PostgreSQL connection. A Meta Orchestrator using OpenAI plans the best agent order in JSON. The flow loops through agents with a switch, including Summarizer, Synthesizer, Peer Reviewer, Sensemaking, Prompt Engineer, and Onboarding. A board style check decides if a redraft is needed. The system builds a review package and ID, emails a reviewer, and waits for the decision. If approved, it writes to PostgreSQL and can also commit to GitHub. Slack notices can be sent to keep the team updated, and the caller gets a final webhook response.

Setup is simple. You need OpenAI, a PostgreSQL database, and an SMTP email account. Slack and GitHub are optional but useful. Expect drafting time to drop from hours to minutes while keeping a strong human check. Great for operations and product teams that manage living documentation and internal handbooks.

What are the key features?

  • Webhook POST intake at pyragogy/process to receive content requests and return a final response.
  • Pre flight PostgreSQL check with SELECT 1 to confirm database access before any heavy work.
  • Meta Orchestrator uses OpenAI gpt 4o with JSON output to plan the best agent sequence.
  • Loop controller and switch route through named agents like Summarizer, Synthesizer, Peer Reviewer, Sensemaking, Prompt Engineer, and Onboarding.
  • Peer Reviewer returns strengths, weaknesses, and actions in JSON, enabling clear improvement steps.
  • Evaluate Board Consensus and redraft path to refine content when feedback requires changes.
  • Generates a review package and unique review ID, sends email, and waits for human approval.
  • On approval, saves to handbook_entries in PostgreSQL and records the approved agent contribution.
  • Optional GitHub commit with dynamic file path for version control and publishing.
  • Optional Slack notifications controlled by a toggle node to keep the team updated.

What are the benefits?

  • Reduce drafting and review time from 3 hours to 20 minutes by automating agent steps and routing.
  • Automate about 70 percent of writing and review tasks while keeping a clear human approval gate.
  • Improve accuracy by 60 percent with peer review JSON feedback and board style consensus before release.
  • Handle up to 5 times more content requests without adding headcount.
  • Connect OpenAI, email, Slack, GitHub, and PostgreSQL in one flow for a single source of truth.

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with OpenAI, Slack, GitHub, PostgreSQL, SMTP and Webhook.site. See the Tools Required section above for links to create accounts with these services.
  3. OpenAI: Double click the Meta Orchestrator node, choose the credential dropdown, click Create new credential, select OpenAI API, and paste your API key from the OpenAI API page. Save.
  4. PostgreSQL: Double click the Check DB Connection node, create a new PostgreSQL credential with host, port, database, user, password, and SSL settings. Test the connection to confirm SELECT 1 works.
  5. SMTP Email: Double click Send Review Request Email, create a new SMTP credential with server, port, username, and password. Set From name and address. Send a test email to confirm delivery.
  6. Slack: If you want notifications, open the Slack nodes, create a new Slack credential, and follow the on screen OAuth steps to install the app to your workspace. Set the Slack Enabled node to true.
  7. GitHub: For commits, open the GitHub node, create a new GitHub credential using a personal access token with repo scope. Set the GitHub Enabled node to true and fill repository, branch, and commit message template.
  8. Webhook: Open the Webhook Trigger node, copy the Test URL, and send a sample POST from Webhook.site or curl. Keep the path pyragogy/process unless your routing requires a change.
  9. Meta Orchestrator: Check that the model is gpt 4o and response format is JSON. Adjust the system prompt only if you need a different agent plan style.
  10. Email review: In Send Review Request Email, set the reviewer address and edit the message to include the approval or rejection links that resume the Wait node. Use the Wait node’s resume URL in the email template.
  11. Database tables: Ensure the handbook_entries table and contribution tables exist. If your schema differs, update the Save nodes to match your table and field names.
  12. Flags and paths: In GitHub Enabled and Slack Enabled, set true or false to match your needs. In Generate GitHub File Path, set the directory and file naming pattern for your repo.
  13. End to end test: Send a real payload to the webhook, watch the agent loop, check the email, approve, and verify records in PostgreSQL and the commit in GitHub. If parsing fails, confirm the Meta Orchestrator returns valid JSON. If email fails, recheck SMTP credentials.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

GitHub

Sign up

Free tier: $0 / mo

OpenAI

Sign up

Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens

PostgreSQL

Sign up

Free: $0 (open-source PostgreSQL License; self-hosted)

Slack

Sign up

Free plan: $0 / mo; limited to 10 apps (third-party or custom) and usable via Slack API

Webhook.site

Sign up

Free tier: $0, public API available; free URLs expire after 7 days and accept up to 100 requests

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.