{
  "openruna_format": "flow-graph-v1",
  "title": "Pyragogy AI Village - Orchestrazione Master (Architettura Profonda V2)",
  "slug": "pyragogy-ai-village-orchestrazione-master-architettura-profonda-v2",
  "source_filename": "generate-collaborative-handbooks-with-gpt4o-multi-agent-orchestration-human-review.json",
  "nodes": [
    {
      "id": "Start",
      "name": "Start",
      "integration": "start",
      "kind": "action"
    },
    {
      "id": "Webhook Trigger",
      "name": "Webhook Trigger",
      "integration": "webhook",
      "kind": "trigger"
    },
    {
      "id": "Check DB Connection",
      "name": "Check DB Connection",
      "integration": "postgres",
      "kind": "action"
    },
    {
      "id": "Meta-Orchestrator",
      "name": "Meta-Orchestrator",
      "integration": "openAi",
      "kind": "action"
    },
    {
      "id": "Parse Orchestration Plan",
      "name": "Parse Orchestration Plan",
      "integration": "function",
      "kind": "action"
    },
    {
      "id": "More Agents to Run?",
      "name": "More Agents to Run?",
      "integration": "if",
      "kind": "logic"
    },
    {
      "id": "Prepare Agent Input",
      "name": "Prepare Agent Input",
      "integration": "function",
      "kind": "action"
    },
    {
      "id": "Route Agents with Switch",
      "name": "Route Agents with Switch",
      "integration": "switch",
      "kind": "logic"
    },
    {
      "id": "Summarizer Agent",
      "name": "Summarizer Agent",
      "integration": "openAi",
      "kind": "action"
    },
    {
      "id": "Synthesizer Agent",
      "name": "Synthesizer Agent",
      "integration": "openAi",
      "kind": "action"
    },
    {
      "id": "Peer Reviewer Agent",
      "name": "Peer Reviewer Agent",
      "integration": "openAi",
      "kind": "action"
    },
    {
      "id": "Sensemaking Agent",
      "name": "Sensemaking Agent",
      "integration": "openAi",
      "kind": "action"
    },
    {
      "id": "Prompt Engineer Agent",
      "name": "Prompt Engineer Agent",
      "integration": "openAi",
      "kind": "action"
    },
    {
      "id": "Onboarding/Explainer Agent",
      "name": "Onboarding/Explainer Agent",
      "integration": "openAi",
      "kind": "action"
    },
    {
      "id": "Add Handbook Metadata",
      "name": "Add Handbook Metadata",
      "integration": "function",
      "kind": "action"
    },
    {
      "id": "Generate Content for Review",
      "name": "Generate Content for Review",
      "integration": "function",
      "kind": "action"
    },
    {
      "id": "Generate Review ID",
      "name": "Generate Review ID",
      "integration": "function",
      "kind": "action"
    },
    {
      "id": "Send Review Request Email",
      "name": "Send Review Request Email",
      "integration": "emailSend",
      "kind": "action"
    },
    {
      "id": "Wait for Human Approval",
      "name": "Wait for Human Approval",
      "integration": "wait",
      "kind": "logic"
    },
    {
      "id": "Human Decision Split",
      "name": "Human Decision Split",
      "integration": "if",
      "kind": "logic"
    },
    {
      "id": "Save to handbook_entries",
      "name": "Save to handbook_entries",
      "integration": "postgres",
      "kind": "action"
    },
    {
      "id": "Prepare Approved Contribution Data",
      "name": "Prepare Approved Contribution Data",
      "integration": "function",
      "kind": "action"
    },
    {
      "id": "Save Agent Contribution (Approved)",
      "name": "Save Agent Contribution (Approved)",
      "integration": "postgres",
      "kind": "action"
    },
    {
      "id": "Generate GitHub File Path",
      "name": "Generate GitHub File Path",
      "integration": "function",
      "kind": "action"
    },
    {
      "id": "GitHub Enabled?",
      "name": "GitHub Enabled?",
      "integration": "if",
      "kind": "logic"
    },
    {
      "id": "Commit to GitHub (Approved)",
      "name": "Commit to GitHub (Approved)",
      "integration": "github",
      "kind": "action"
    },
    {
      "id": "Log Human Rejection",
      "name": "Log Human Rejection",
      "integration": "function",
      "kind": "action"
    },
    {
      "id": "Merge Archivist Paths",
      "name": "Merge Archivist Paths",
      "integration": "merge",
      "kind": "logic"
    },
    {
      "id": "Evaluate Board Consensus",
      "name": "Evaluate Board Consensus",
      "integration": "function",
      "kind": "action"
    },
    {
      "id": "Check Redraft Needed",
      "name": "Check Redraft Needed",
      "integration": "if",
      "kind": "logic"
    },
    {
      "id": "Handle Redraft",
      "name": "Handle Redraft",
      "integration": "function",
      "kind": "action"
    },
    {
      "id": "Process Agent Output",
      "name": "Process Agent Output",
      "integration": "function",
      "kind": "action"
    },
    {
      "id": "Slack Enabled?",
      "name": "Slack Enabled?",
      "integration": "if",
      "kind": "logic"
    },
    {
      "id": "Notify Slack",
      "name": "Notify Slack",
      "integration": "slack",
      "kind": "action"
    },
    {
      "id": "Final Response",
      "name": "Final Response",
      "integration": "respondToWebhook",
      "kind": "action"
    }
  ],
  "edges": [
    {
      "from": "Webhook Trigger",
      "to": "Check DB Connection"
    },
    {
      "from": "Check DB Connection",
      "to": "Meta-Orchestrator"
    },
    {
      "from": "Meta-Orchestrator",
      "to": "Parse Orchestration Plan"
    },
    {
      "from": "Parse Orchestration Plan",
      "to": "More Agents to Run?"
    },
    {
      "from": "More Agents to Run?",
      "to": "Prepare Agent Input"
    },
    {
      "from": "More Agents to Run?",
      "to": "Slack Enabled?"
    },
    {
      "from": "Prepare Agent Input",
      "to": "Route Agents with Switch"
    },
    {
      "from": "Route Agents with Switch",
      "to": "Summarizer Agent"
    },
    {
      "from": "Route Agents with Switch",
      "to": "Synthesizer Agent"
    },
    {
      "from": "Route Agents with Switch",
      "to": "Peer Reviewer Agent"
    },
    {
      "from": "Route Agents with Switch",
      "to": "Sensemaking Agent"
    },
    {
      "from": "Route Agents with Switch",
      "to": "Prompt Engineer Agent"
    },
    {
      "from": "Route Agents with Switch",
      "to": "Onboarding/Explainer Agent"
    },
    {
      "from": "Route Agents with Switch",
      "to": "Add Handbook Metadata"
    },
    {
      "from": "Summarizer Agent",
      "to": "Process Agent Output"
    },
    {
      "from": "Synthesizer Agent",
      "to": "Process Agent Output"
    },
    {
      "from": "Peer Reviewer Agent",
      "to": "Sensemaking Agent"
    },
    {
      "from": "Sensemaking Agent",
      "to": "Prompt Engineer Agent"
    },
    {
      "from": "Prompt Engineer Agent",
      "to": "Evaluate Board Consensus"
    },
    {
      "from": "Onboarding/Explainer Agent",
      "to": "Process Agent Output"
    },
    {
      "from": "Add Handbook Metadata",
      "to": "Generate Content for Review"
    },
    {
      "from": "Generate Content for Review",
      "to": "Generate Review ID"
    },
    {
      "from": "Generate Review ID",
      "to": "Send Review Request Email"
    },
    {
      "from": "Send Review Request Email",
      "to": "Wait for Human Approval"
    },
    {
      "from": "Wait for Human Approval",
      "to": "Human Decision Split"
    },
    {
      "from": "Human Decision Split",
      "to": "Save to handbook_entries"
    },
    {
      "from": "Human Decision Split",
      "to": "Log Human Rejection"
    },
    {
      "from": "Save to handbook_entries",
      "to": "Prepare Approved Contribution Data"
    },
    {
      "from": "Prepare Approved Contribution Data",
      "to": "Save Agent Contribution (Approved)"
    },
    {
      "from": "Save Agent Contribution (Approved)",
      "to": "Generate GitHub File Path"
    },
    {
      "from": "Generate GitHub File Path",
      "to": "GitHub Enabled?"
    },
    {
      "from": "GitHub Enabled?",
      "to": "Commit to GitHub (Approved)"
    },
    {
      "from": "GitHub Enabled?",
      "to": "Merge Archivist Paths"
    },
    {
      "from": "Commit to GitHub (Approved)",
      "to": "Merge Archivist Paths"
    },
    {
      "from": "Log Human Rejection",
      "to": "Merge Archivist Paths"
    },
    {
      "from": "Merge Archivist Paths",
      "to": "Process Agent Output"
    },
    {
      "from": "Evaluate Board Consensus",
      "to": "Check Redraft Needed"
    },
    {
      "from": "Check Redraft Needed",
      "to": "Handle Redraft"
    },
    {
      "from": "Check Redraft Needed",
      "to": "Process Agent Output"
    },
    {
      "from": "Handle Redraft",
      "to": "More Agents to Run?"
    },
    {
      "from": "Process Agent Output",
      "to": "More Agents to Run?"
    },
    {
      "from": "Slack Enabled?",
      "to": "Notify Slack"
    },
    {
      "from": "Slack Enabled?",
      "to": "Final Response"
    },
    {
      "from": "Notify Slack",
      "to": "Final Response"
    }
  ]
}