# Pyragogy AI-driven handbook generator with OpenAI and GitHub: n8n workflow

> Started by another system calling it, and works across Email, GitHub, Postgres and Slack. It hands the judgement calls to OpenAI.

Source: https://millionrounds.com/workflow/pyragogy-ai-driven-handbook-generator-with-openai-and-github (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Chat assistants](https://millionrounds.com/workflows?category=Chat+assistants#library)

# Pyragogy AI-driven handbook generator with OpenAI and GitHub

Started by another system calling it, and works across Email, GitHub, Postgres and Slack. It hands the judgement calls to OpenAI. 35 steps, 6 branches, 1 loop or waits: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fpyragogy-ai-driven-handbook-generator-with-openai-and-github)

**35 steps** Large: read it before trusting it with anything live

**6** Branches: places the flow splits

**1** Loop or waits

**4** Services it connects to

## The flow

Starts it 2 Model 7 Logic 19 Service 7

The steps in the order they run, from what starts it.

- 1 **Start** Start *Service*
- 2 **Webhook Trigger** Webhook *Starts it*
- 3 **Synthesizer Agent** Open Ai *Model*
- 4 **Peer Reviewer Agent** Open Ai *Model*
- 5 **Onboarding/Explainer Agent** Open Ai *Model*
- 6 **Add Handbook Metadata** Function *Logic*
- 7 **Check DB Connection** Postgres *Service*
- 8 **Process Agent Output** Function *Logic*
- 9 **Sensemaking Agent** Open Ai *Model*
- 10 **Generate Content for Review** Function *Logic*
- 11 **Meta-Orchestrator** Open Ai *Model*
- 12 **More Agents to Run?** If *Logic*
- 13 **Prompt Engineer Agent** Open Ai *Model*
- 14 **Generate Review ID** Function *Logic*
- 15 **Parse Orchestration Plan** Function *Logic*
- 16 **Prepare Agent Input** Function *Logic*
- 17 **Slack Enabled?** If *Logic*
- 18 **Evaluate Board Consensus** Function *Logic*
- 19 **Send Review Request Email** Email Send *Service*
- 20 **Route Agents with Switch** Switch *Logic*
- 21 **Notify Slack** Slack *Service*
- 22 **Final Response** Respond To Webhook *Starts it*
- 23 **Check Redraft Needed** If *Logic*
- 24 **Wait for Human Approval** Wait *Logic*
- 25 **Summarizer Agent** Open Ai *Model*
- 26 **Handle Redraft** Function *Logic*
- 27 **Human Decision Split** If *Logic*
- 28 **Save to handbook_entries** Postgres *Service*
- 29 **Log Human Rejection** Function *Logic*
- 30 **Prepare Approved Contribution Data** Function *Logic*
- 31 **Merge Archivist Paths** Merge *Logic*
- 32 **Save Agent Contribution (Approved)** Postgres *Service*
- 33 **Generate GitHub File Path** Function *Logic*
- 34 **GitHub Enabled?** If *Logic*
- 35 **Commit to GitHub (Approved)** Github *Service*

## How it's built

- **Starts on:** Another system calling it
- **Steps:** 35, with 6 branches, 1 loop or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Email, GitHub, Postgres, Slack
- **Model:** OpenAI

## Questions

What does it need to run?

An n8n account, plus your own Email, GitHub, Postgres and Slack accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on another system calling it.

Does it use AI?

Yes. It calls OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 35 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 35 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fpyragogy-ai-driven-handbook-generator-with-openai-and-github)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Email](https://millionrounds.com/workflows?service=Email#library)[GitHub](https://millionrounds.com/workflows?service=GitHub#library)[Postgres](https://millionrounds.com/workflows?service=Postgres#library)[Slack](https://millionrounds.com/workflows?service=Slack#library)

## Workflows like it

Also chat assistants, with the same services where possible, closest in size first.

- [**Pyragogy AI Village - Orchestration Master with OpenAI** 35 steps · calls a model · Email, GitHub](https://millionrounds.com/workflow/pyragogy-ai-village-orchestrazione-master-with-openai)
- [**Assist hospital doctors with Telegram and OpenAI** 34 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/assist-hospital-doctors-with-telegram-and-openai)
- [**Guard releases and investigate regressions with Browserbase** 34 steps · calls a model · Email, GitHub](https://millionrounds.com/workflow/guard-releases-and-investigate-regressions-with-browserbase)
- [**Manage rent, maintenance and tenant messages with OpenAI** 34 steps · calls a model · Google Sheets, Slack](https://millionrounds.com/workflow/manage-rent-maintenance-and-tenant-messages-with-openai)
- [**Triage project and UAT feedback with OpenAI and Jira** 32 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/triage-project-and-uat-feedback-with-openai-and-jira)
- [**Turn ideas into movies with DeepSeek and RunwayML** 38 steps · calls a model · Dropbox, Notion](https://millionrounds.com/workflow/turn-ideas-into-movies-with-deepseek-and-runwayml)
