{
  "name": "HITL Agency Post Content Flow",
  "nodes": [
    {
      "parameters": {
        "content": "# 🎨Marcus Post Content\n## Generate Post Content\n\n## Content Manager generates copy / Imaging / video, requests a revision loop, approves copy send --> Taylor, or cancels.",
        "height": 352,
        "width": 384,
        "color": "#2B4A54"
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3680,
        2016
      ],
      "typeVersion": 1,
      "id": "842658be-2c62-4d1c-a7d3-fd01da85f635",
      "name": "Sticky Note10"
    },
    {
      "parameters": {
        "jsCode": "// Ver 2.0 23 May 26 Build brief_id with sequential initial tracking identifier.\n// Old brief_id format: MMDDYY-Client-PlatformCode (e.g., 052226-Loopin-LI)\n// New brief_id format: MMDDYY-Client-PlatformCode-001 (e.g., 052226-Loopin-LI-001)\n\nconst brief = $('Parse — Brief Fields').first().json;\nconst now   = new Date();\n\nconst mm = String(now.getMonth() + 1).padStart(2, '0');\nconst dd = String(now.getDate()).padStart(2, '0');\nconst yy = String(now.getFullYear()).slice(-2);\n\nconst clientSlug = brief.Client.replace(/\\s+/g, '');\n\nconst platformMap = {\n  'LinkedIn':    'LI',\n  'X (Twitter)': 'TW',\n  'Instagram':   'IG'\n};\nconst platformCode = platformMap[brief.Platform] || 'XX';\n\n// brief_id now natively starts at suffix -001 on the first pass\nconst brief_id = `${mm}${dd}${yy}-${clientSlug}-${platformCode}-001`;\n\n// Merge all upstream data into one flat object for downstream nodes.\nconst clientProfile = $('DB - Lookup Client').first().json;\n\nreturn [{\n  json: {\n    // IDs \n    brief_id,\n    \n    // Brief fields\n    client:       brief.Client,\n    platform:     brief.Platform,\n    content_type: brief['Content Type'],\n    topic_hint:   brief['Topic Hint'],\n    tone_note:    brief['Tone Note'],\n    submitted_at: new Date().toISOString(),\n    \n    // Client profile from relay-database (all 20 fields passed through)\n    brand_name:                  clientProfile.brand_name,\n    company_size:                clientProfile.company_size,\n    work_model:                  clientProfile.work_model,\n    slack_channel:               clientProfile.slack_channel,\n    team_strategist:             clientProfile.team_strategist,\n    team_content:                clientProfile.team_content,\n    team_approval:               clientProfile.team_approval,\n    product:                     clientProfile.product,\n    target_audience:             clientProfile.target_audience,\n    target_audience_pain_point:  clientProfile.target_audience_pain_point,\n    brand_voice:                 clientProfile.brand_voice,\n    brand_goal:                  clientProfile.brand_goal,\n    tone_linkedin:               clientProfile.tone_linkedin,\n    linkedin_hook_formulas:      clientProfile['linkedin_hook formulas'],\n    tone_x:                      clientProfile.tone_x,\n    x_hook_formulas:             clientProfile.x_hook_formulas,\n    tone_instagram:              clientProfile.tone_instagram,\n    language_avoid:              clientProfile.language_avoid,\n    visual_style:                clientProfile.visual_style,\n    key_messages:                clientProfile.key_messages\n\n  }\n}];"
      },
      "id": "c134202c-2f50-4cd2-a6c8-c704aa5b7ad1",
      "name": "Generate brief_id",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -1584,
        736
      ]
    },
    {
      "parameters": {
        "toolDescription": "Search the web for current trends, stats, and platform conversations relevant to the content brief. Input: a single search query string in the 'query' parameter.",
        "method": "POST",
        "url": "https://google.serper.dev/search",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\"q\": \"{{ $fromAI('query', 'Search query string') }}\"}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequestTool",
      "typeVersion": 4.3,
      "position": [
        -2144,
        1520
      ],
      "id": "a6cda8cf-a4b3-41b3-bd39-e626d8fe6f29",
      "name": "Serper",
      "credentials": {
        "httpHeaderAuth": {
          "id": "zRA68PHRtnA9PBxu",
          "name": "Serper"
        }
      }
    },
    {
      "parameters": {
        "formTitle": "New Strategy Brief",
        "formDescription": "Submit a new content request (new brief_id). Your workflow will move this brief through Sofia (strategy), Marcus (creative), and Taylor (review) before the post is ready.",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Client",
              "placeholder": "e.g. Loopin",
              "requiredField": true
            },
            {
              "fieldLabel": "Platform",
              "fieldType": "dropdown",
              "fieldOptions": {
                "values": [
                  {
                    "option": "LinkedIn"
                  },
                  {
                    "option": "X (Twitter)"
                  },
                  {
                    "option": "Instagram"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldLabel": "Content Type",
              "fieldType": "dropdown",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Thought leadership"
                  },
                  {
                    "option": "Product announcement"
                  },
                  {
                    "option": "Customer story"
                  },
                  {
                    "option": "Culture post"
                  },
                  {
                    "option": "Data post"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldLabel": "Topic Hint",
              "placeholder": "A seed idea or theme — optional"
            },
            {
              "fieldLabel": "Tone Note",
              "placeholder": "Any specific tone or framing guidance — optional"
            }
          ]
        },
        "options": {}
      },
      "id": "5cb6b096-bad0-482c-bff2-d1245314f185",
      "name": "Brief Intake Form",
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.2,
      "position": [
        -2720,
        736
      ],
      "webhookId": "8a8310db-a866-41a5-bd9f-ea08a1ba0c47"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "c3b5b10e-6ef2-4cab-8bbe-2a15e31532f0",
              "name": "Client",
              "value": "={{ $json.Client }}",
              "type": "string"
            },
            {
              "id": "31fdaa93-d287-4a77-9d1e-719c930f2c49",
              "name": "Platform",
              "value": "={{ $json.Platform }}",
              "type": "string"
            },
            {
              "id": "d9eb8790-a32f-4c9a-8b80-b9472441c45f",
              "name": "Content Type",
              "value": "={{ $json[\"Content Type\"] }}",
              "type": "string"
            },
            {
              "id": "61e7ba30-a817-4975-bfad-64c0dcef12f3",
              "name": "Topic Hint",
              "value": "={{ $json[\"Topic Hint\"] }}",
              "type": "string"
            },
            {
              "id": "67a4897f-a6c5-4cc1-88cc-8d45101312b8",
              "name": "Tone Note",
              "value": "={{ $json[\"Tone Note\"] }}",
              "type": "string"
            },
            {
              "id": "8376b4bb-46ac-4a87-a34b-f479ecd704c0",
              "name": "submittedAt",
              "value": "={{ $json.submittedAt }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "dde460aa-68ad-4c7b-907a-37d1cbe5a5d3",
      "name": "Parse — Brief Fields",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -2288,
        736
      ],
      "notes": "Parses pipe-delimited /brief command.\nFormat: /brief Loopin | LinkedIn | Thought leadership | async standups | keep it punchy\nAll fields after client are optional."
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"post_angle_1\": {\n      \"type\": \"string\",\n      \"description\": \"Primary concept. 3-5 sentences: visual/art direction prompt + named hook formula.\"\n    },\n    \"post_angle_2\": {\n      \"type\": \"string\",\n      \"description\": \"Backup option 1. 3-5 sentences: visual prompt + alternative hook formula.\"\n    },\n    \"post_angle_3\": {\n      \"type\": \"string\",\n      \"description\": \"Backup option 2. 3-5 sentences: visual prompt + alternative hook formula.\"\n    },\n    \"brief_id\": {\n      \"type\": \"string\",\n      \"description\": \"The revision brief_id if this is a revision run; the original brief_id otherwise.\"\n    },\n    \"is_revision\": {\n      \"type\": \"boolean\",\n      \"description\": \"True if Revise Instruct was provided; false for a fresh brief.\"\n    }\n  },\n  \"required\": [\"post_angle_1\", \"post_angle_2\", \"post_angle_3\", \"brief_id\", \"is_revision\"]\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        -1904,
        1520
      ],
      "id": "b8553180-ab4d-432c-8252-9f83b28fe923",
      "name": "Structured Output Parser"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=### INPUT CONTEXT\nAnalyze the following parameters for the upcoming ad campaign:\n\n<revision>\nRevise Instruct: {{ $('Revise Instruct').isExecuted ? $('Revise Instruct').first().json.revise_instruct : 'n/a' }}\n\nRevised Brief ID: {{ $('Revise Instruct').isExecuted ? $('Revise Instruct').first().json.revised_brief_id : 'n/a' }}\n</revision>\n\n<campaign_brief>\nBrief ID: {{ $('Revise Instruct').isExecuted ? $('Revise Instruct').item.json.revised_brief_id : $('Generate brief_id').item.json.brief_id }}\nClient: {{ $('Generate brief_id').item.json.client }}\nPlatform: {{ $('Generate brief_id').item.json.platform }}\nContent Type: {{ $('Generate brief_id').item.json.content_type }}\nTopic Hint: {{ $('Generate brief_id').item.json.topic_hint }}\nTone: {{ $('Generate brief_id').item.json.tone_note }}\n</campaign_brief>\n\n<client_profile>\nClient: {{ $('Generate brief_id').item.json.brand_name }}\nProduct: {{ $('Generate brief_id').item.json.product }}\nTarget audience: {{ $('Generate brief_id').item.json.target_audience }}\nAudience pain point: {{ $('Generate brief_id').item.json.target_audience_pain_point }}\nBrand voice: {{ $('Generate brief_id').item.json.brand_voice }}\nBrand goal: {{ $('Generate brief_id').item.json.brand_goal }}\nKey messages: {{ $('Generate brief_id').item.json.key_messages }}\n</client_profile>\n\n<platform_tone>\n{{ \n  (() => {\n    const data = $('Generate brief_id').item.json;\n    if (data.platform === 'LinkedIn') {\n      return `LinkedIn tone: ${data.tone_linkedin}\\nHook formulas to use: ${data.linkedin_hook_formulas}`;\n    } else if (data.platform === 'X (Twitter)') {\n      return `X tone: ${data.tone_x}\\nHook formulas to use: ${data.x_hook_formulas}`;\n    } else if (data.platform === 'Instagram') {\n      return `Instagram tone: ${data.tone_instagram}`;\n    }\n    return '';\n  })()\n}}\n</platform_tone>\n\n<language_avoid>\n{{ $('Generate brief_id').item.json.language_avoid }}\n</language_avoid>\n\n---\n\n# READ INPUTS\n- Read all inputs to absorb the direction of your strategy.\n\n# CHECK REVISION\n1. Check for Revise Instruct:\n- If Revise Instruct is 'n/a' skip tool call and proceed to CREATE POSTS.\n- If Revise Instruct is not n/a:\na) Call Get Post Angles tool using Brief ID from <campaign_brief> block.\nb) Retrieve and review your previous Post Angles:\npost_angle_1\npost_angle_2\npost_angle_3\nc) Use CREATE POST ANGLES to revise these 3 your previous Post Angles per Revise Instruct.\nd) Output 3 revised post angles.\n- is_revision = true if Revise Instruct is not 'n/a'; false otherwise.\n\n# CREATE POST ANGLES\n1. Use Content Type, Topic Hint and Tone to create 3 distinct angles for an Ad campaign for this Client's Product. The <platform_tone> assists in tweaking your Angle for the social platform.\n- For each angle, write a 3-4 sentence block that details Media and Copy strategy overview.\n- Currently, Media will be a single image, no split screens. One sentence, for downline editor to enhance.\n- Clean, fresh, humourous, simple. Not dark and distressed.\n- No preamble, just Media + Copy.\n\n2. Map these 3 post angles to the required keys in the raw JSON schema below.\n- add brief_id\n- add is_revision\n\n<OUTPUT FORMAT>\n## BRIEF ID RULE (critical — this is the database key)\n- If is_revision = true  → use the Revise Brief ID from the <revision> block.\n- If is_revision = false → use the Brief ID from the <campaign_brief> block.\n\n## Always output this value as-is. Do not modify, infer, or generate a new ID.\nReturn only a raw JSON object matching this schema. Do not include markdown code fences (like ```json). No preamble. No chat text.\n{\n  \"post_angle_1\": \"...\",\n  \"post_angle_2\": \"...\",\n  \"post_angle_3\": \"...\",\n  \"brief_id\": \"<see BRIEF ID RULE above>\",\n  \"is_revision\": true or false\n}\n</OUTPUT FORMAT>",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "You are Sofia AI, a senior content strategist at Relay — a social media agency. Your sole purpose is to research and generate highly optimized, platform-native content angles based on incoming campaign briefs.\n\n### CONSTRAINTS & RULES\n1. Never use words from the language_avoid list provided in the user brief.\n2. Use Client's voice only. Short sentences.\n3. Deliver exactly 3 distinct conceptual approaches for this campaign, mapped to:\n   - post_angle_1 (Primary Concept): The strongest, immediate implementation.\n   - post_angle_2 (Backup Option 1): An alternative direction for executive review.\n   - post_angle_3 (Backup Option 2): A second alternative direction in case the first is declined.\n4. Output each string as \"Media:... Copy:...\"\n4. Each angle must blend the specific copywriting text strategy (using a named hook formula) and a descriptive visual/art direction prompt for the design team.\n",
          "maxIterations": 6
        }
      },
      "id": "6648afec-dee3-4de6-b964-d7c3a460085b",
      "name": "Sofia AI",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.7,
      "position": [
        -2176,
        1296
      ],
      "notes": "Connect: OpenAI node (Groq OpenAI-compat) as Chat Model child. Connect SerpAPI or Tavily Tool node as Tool child."
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.client }}",
                    "rightValue": "",
                    "operator": {
                      "type": "string",
                      "operation": "notEmpty"
                    },
                    "id": "d092ca27-f3fa-4ebb-abc4-b68744853a62"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "client_exists"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.client }}",
                    "rightValue": "",
                    "operator": {
                      "type": "string",
                      "operation": "empty"
                    },
                    "id": "4cd209b5-5338-4482-8e10-c703aff821ae"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "new_client"
            }
          ]
        },
        "options": {}
      },
      "id": "d40d319f-d46d-4d36-990e-82d02b6dcacb",
      "name": "New Client?",
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        -1840,
        736
      ]
    },
    {
      "parameters": {
        "operation": "sendAndWait",
        "sendTo": "YOUR_CUST_SERV_EMAIL",
        "subject": "=New client submitted via Stratgey Dept: {{ $('Parse — Brief Fields').item.json.Client }}",
        "message": "=A /brief command was submitted for a client not in the Relay Database.\n\nClient name: {{ $('Parse — Brief Fields').item.json.Client }}\nStratgey Info:  {{ $('Parse — Brief Fields').item.json.Platform }} * {{ $('Parse — Brief Fields').item.json['Content Type'] }} * {{ $('Parse — Brief Fields').item.json['Topic Hint'] }} * {{ $('Parse — Brief Fields').item.json['Tone Note'] }} * {{ $('Parse — Brief Fields').item.json.submittedAt }}\n\nPlease contact sales rep to acquire all necessary Client info and enter Client to Relay-Database.",
        "approvalOptions": {
          "values": {
            "approvalType": "double",
            "approveLabel": "Client Created",
            "disapproveLabel": "Client Not Created - Pending"
          }
        },
        "options": {}
      },
      "id": "bfcf4fa8-b415-439d-9485-ebfc6a3de57a",
      "name": "Email to IT - New Client",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        -1840,
        960
      ],
      "webhookId": "53da34b7-9ae4-4a76-8463-416ca24fff6e",
      "credentials": {
        "gmailOAuth2": {
          "id": "zIDNV6m7e3UHAGzZ",
          "name": "Gmail account"
        }
      }
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "C0B5JFMJK6E",
          "mode": "id"
        },
        "text": "=🎯 SOFIA: Response from IT: Client {{ $('Parse — Brief Fields').item.json.Client }} status of creating new client: {{ $json.data }}\nIf Client created, re-submit New Brief\n-OR IF- \nClient not created - await further instructs",
        "otherOptions": {}
      },
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.4,
      "position": [
        -1584,
        960
      ],
      "id": "1b6ea72c-b90a-46e7-a233-ce16f0bac737",
      "name": "IT Mssg",
      "webhookId": "d8df9fec-b77a-45fb-b8d1-458de15985ab",
      "credentials": {
        "slackApi": {
          "id": "V3dfJrNTD6Y86lSH",
          "name": "Slack 2"
        }
      }
    },
    {
      "parameters": {
        "resume": "form",
        "formTitle": "🎯 Sofia — Review Content Angles",
        "formDescription": "=<h>-Relay-</h3>\nBrief: {{ $('Generate brief_id').item.json.client }} · {{ $('Generate brief_id').item.json.platform }} · {{ $('Generate brief_id').item.json.content_type }}\n\nTopic hint: {{ $('Generate brief_id').item.json.topic_hint || '(none)' }}\n\nProposed:\n<h3>Post Angle 1:</h3> {{ $('Sofia AI').item.json.output.post_angle_1 }}\n---\n<h3>Post Angle 2:</h3> {{ $('Sofia AI').item.json.output.post_angle_2 }}\n---\n<h3>Post Angle 3:</h3> {{ $('Sofia AI').item.json.output.post_angle_3 }}\n---\nApprove one angle to send to Marcus, or request new angles with notes.",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Decision",
              "fieldType": "dropdown",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Approved"
                  },
                  {
                    "option": "Revise"
                  },
                  {
                    "option": "Canceled"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldLabel": "Approved Angle",
              "fieldType": "dropdown",
              "defaultValue": "1",
              "fieldOptions": {
                "values": [
                  {
                    "option": "1"
                  },
                  {
                    "option": "2"
                  },
                  {
                    "option": "3"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldLabel": "Approve Note",
              "fieldType": "textarea",
              "placeholder": "Why the approved angle?"
            },
            {
              "fieldLabel": "Revise Note",
              "fieldType": "textarea",
              "placeholder": "Instruct to Sofia AI for revision"
            }
          ]
        },
        "limitWaitTime": true,
        "resumeAmount": 8,
        "options": {}
      },
      "id": "3bbe07c5-d427-418e-adb7-6a341c92d31b",
      "name": "Approve Form",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -1008,
        1312
      ],
      "webhookId": "sofia-approval"
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "C0B5JFMJK6E",
          "mode": "id"
        },
        "text": "=🎯 SOFIA: Approval received! 👍, sending {{ $('OBJECTS Sofia').item.json.output.brief_id }} to Marcus!",
        "otherOptions": {}
      },
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.4,
      "position": [
        -256,
        1104
      ],
      "id": "c611fd84-2eeb-4ec6-840f-b7bc457ef07f",
      "name": "Approved Mssg",
      "webhookId": "d8df9fec-b77a-45fb-b8d1-458de15985ab",
      "credentials": {
        "slackApi": {
          "id": "V3dfJrNTD6Y86lSH",
          "name": "Slack 2"
        }
      }
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "C0B5JFMJK6E",
          "mode": "id"
        },
        "text": "=🎯 SOFIA: Note that Post Angles {{ $('OBJECTS Sofia').item.json.output.brief_id }} have been duly cancelled",
        "otherOptions": {}
      },
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.4,
      "position": [
        -256,
        1536
      ],
      "id": "5e3aaa48-4d67-48ff-8cd5-98df07871a63",
      "name": "Cancelled Mssg",
      "webhookId": "d8df9fec-b77a-45fb-b8d1-458de15985ab",
      "credentials": {
        "slackApi": {
          "id": "V3dfJrNTD6Y86lSH",
          "name": "Slack 2"
        }
      }
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8",
          "mode": "list",
          "cachedResultName": "Ad_Pipeline_v2",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 2027252897,
          "mode": "list",
          "cachedResultName": "Strategy",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit#gid=2027252897"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "brief_id",
              "lookupValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('values0_Value', ``, 'string') }}"
            }
          ]
        },
        "options": {
          "dataLocationOnSheet": {
            "values": {
              "rangeDefinition": "detectAutomatically"
            }
          }
        }
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.7,
      "position": [
        -2048,
        1520
      ],
      "id": "d8a47424-7fa0-4075-aad7-1666b26c41af",
      "name": "Get Post Angles",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "CjB4pVPhUNjDvDTe",
          "name": "DS Ggl Sheet"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "55d136e4-dd68-44aa-b746-068421f4bd0e",
              "leftValue": "={{ $json.output.is_revision }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        -1568,
        1296
      ],
      "id": "9fe2cbd6-d08f-4012-b1f2-f298dcafa49d",
      "name": "If Revision"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8",
          "mode": "list",
          "cachedResultName": "Ad_Pipeline_v2",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 2027252897,
          "mode": "list",
          "cachedResultName": "Strategy",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit#gid=2027252897"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "brief_id": "={{ $json.brief_id }}",
            "submitted_at": "={{ $json.submitted_at }}",
            "client": "={{ $json.client }}",
            "platform": "={{ $json.platform }}",
            "content_type": "={{ $json.content_type }}",
            "topic_hint": "={{ $json.topic_hint }}",
            "tone_note": "={{ $json.tone_note }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "brief_id",
              "displayName": "brief_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "submitted_at",
              "displayName": "submitted_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "client",
              "displayName": "client",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "platform",
              "displayName": "platform",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "content_type",
              "displayName": "content_type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "topic_hint",
              "displayName": "topic_hint",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "tone_note",
              "displayName": "tone_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "post_angle_1",
              "displayName": "post_angle_1",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "post_angle_2",
              "displayName": "post_angle_2",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "post_angle_3",
              "displayName": "post_angle_3",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "approved_angle",
              "displayName": "approved_angle",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "approve_note",
              "displayName": "approve_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "revise_note",
              "displayName": "revise_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "rejected_by_stage",
              "displayName": "rejected_by_stage",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "strategy_status",
              "displayName": "strategy_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "af7d6f9e-eb79-49ab-aa4e-5049e67a0712",
      "name": "DB  - Log Brief",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -2464,
        1296
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "CjB4pVPhUNjDvDTe",
          "name": "DS Ggl Sheet"
        }
      }
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1xj7qATHD-qM-bzEFkThkW1wDo_c9SMVbsnsBwNA5RX0",
          "mode": "list",
          "cachedResultName": "Relay-Database",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xj7qATHD-qM-bzEFkThkW1wDo_c9SMVbsnsBwNA5RX0/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 127845294,
          "mode": "list",
          "cachedResultName": "client-database",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xj7qATHD-qM-bzEFkThkW1wDo_c9SMVbsnsBwNA5RX0/edit#gid=127845294"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "client",
              "lookupValue": "={{ $json.Client }}"
            }
          ]
        },
        "options": {}
      },
      "id": "10552dcd-74c0-435e-bc82-0f8b96c6afc7",
      "name": "DB - Lookup Client",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -2064,
        736
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "CjB4pVPhUNjDvDTe",
          "name": "DS Ggl Sheet"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8",
          "mode": "list",
          "cachedResultName": "Ad_Pipeline_v2",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 2027252897,
          "mode": "list",
          "cachedResultName": "Strategy",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit#gid=2027252897"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "approved_angle": "={{ $json['Approved Angle'] }}",
            "row_number": 0,
            "strategy_status": "Approved",
            "approve_note": "={{ $json['Approve Note'] }}",
            "brief_id": "={{ $('OBJECTS Sofia').last().json.output.brief_id }}"
          },
          "matchingColumns": [
            "brief_id"
          ],
          "schema": [
            {
              "id": "brief_id",
              "displayName": "brief_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "submitted_at",
              "displayName": "submitted_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "client",
              "displayName": "client",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "platform",
              "displayName": "platform",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "content_type",
              "displayName": "content_type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "topic_hint",
              "displayName": "topic_hint",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "tone_note",
              "displayName": "tone_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "post_angle_1",
              "displayName": "post_angle_1",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "post_angle_2",
              "displayName": "post_angle_2",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "post_angle_3",
              "displayName": "post_angle_3",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "approved_angle",
              "displayName": "approved_angle",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "approve_note",
              "displayName": "approve_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "revise_note",
              "displayName": "revise_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "rejected_by_stage",
              "displayName": "rejected_by_stage",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "strategy_status",
              "displayName": "strategy_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "63fa4d30-5731-4713-8055-8a2ba7c41c06",
      "name": "DB - Log Approved",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -480,
        1104
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "CjB4pVPhUNjDvDTe",
          "name": "DS Ggl Sheet"
        }
      },
      "notes": "approved output → write approval to Strategy tab then pass to Marcus leg"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8",
          "mode": "list",
          "cachedResultName": "Ad_Pipeline_v2",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 2027252897,
          "mode": "list",
          "cachedResultName": "Strategy",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit#gid=2027252897"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": 0,
            "rejected_by_stage": "Sofia",
            "strategy_status": "Cancelled",
            "brief_id": "={{ $('OBJECTS Sofia').last().json.output.brief_id }}"
          },
          "matchingColumns": [
            "brief_id"
          ],
          "schema": [
            {
              "id": "brief_id",
              "displayName": "brief_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "submitted_at",
              "displayName": "submitted_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "client",
              "displayName": "client",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "platform",
              "displayName": "platform",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "content_type",
              "displayName": "content_type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "topic_hint",
              "displayName": "topic_hint",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "tone_note",
              "displayName": "tone_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "post_angle_1",
              "displayName": "post_angle_1",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "post_angle_2",
              "displayName": "post_angle_2",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "post_angle_3",
              "displayName": "post_angle_3",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "approved_angle",
              "displayName": "approved_angle",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "approve_note",
              "displayName": "approve_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "revise_note",
              "displayName": "revise_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "rejected_by_stage",
              "displayName": "rejected_by_stage",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "strategy_status",
              "displayName": "strategy_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "5f5a6706-1688-4cc0-b66d-d14e8fc77ee4",
      "name": "DB -  Log Cancel",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -480,
        1536
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "CjB4pVPhUNjDvDTe",
          "name": "DS Ggl Sheet"
        }
      },
      "notes": "approved output → write approval to Strategy tab then pass to Marcus leg"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json['Decision'] }}",
                    "rightValue": "Approved",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "c9cd561c-989b-4746-ab86-e0e3cc409954"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Approved"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json['Decision'] }}",
                    "rightValue": "Revise",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "83e486f2-7912-43dd-8683-39b1e5a8c1bc"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "revise"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "f19930ce-73d0-4741-89f7-c01d1fbab7d6",
                    "leftValue": "={{ $json['Decision'] }}",
                    "rightValue": "Canceled",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "cancel"
            }
          ]
        },
        "options": {}
      },
      "id": "fec93c63-8ef2-4a94-93d4-d8309ace0e53",
      "name": "Route Decision",
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        -736,
        1296
      ]
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"post_text\": {\n      \"type\": \"string\",\n      \"description\": \"The full social media post copy.\"\n    },\n    \"image_prompt\": {\n      \"type\": \"string\",\n      \"description\": \"The image generation prompt for the visual asset.\"\n    },\n    \"brief_id\": {\n      \"type\": \"string\",\n      \"description\": \"The revision brief_id if this is a revision run; the original brief_id otherwise.\"\n    },\n    \"is_revision\": {\n      \"type\": \"boolean\",\n      \"description\": \"True if this is a revision run; false for a fresh brief.\"\n    },\n    \"approved_angle\": {\n      \"type\": \"string\",\n      \"description\": \"The approved post.\"\n    },\n    \"client\": {\n      \"type\": \"string\",\n      \"description\": \"The client name.\"\n    },\n    \"platform\": {\n      \"type\": \"string\",\n      \"description\": \"The social media platform.\"\n    },\n    \"content_type\": {\n      \"type\": \"string\",\n      \"description\": \"The type of content being created.\"\n    }\n  },\n  \"required\": [\n    \"post_text\",\n    \"image_prompt\",\n    \"brief_id\",\n    \"is_revision\",\n    \"approved_angle\",\n    \"client\",\n    \"platform\",\n    \"content_type\"\n  ]\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        -1952,
        2368
      ],
      "id": "1db6e1d0-9933-4da8-badd-09d78ea60e8e",
      "name": "parse"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Brief ID: {{ $('Marcus Webhook').isExecuted ? $('Marcus Webhook').item.json.body.brief_id : $('M-Instruct').isExecuted ? $('M-Instruct').item.json.brief_id : $('T-Instruct').item.json.brief_id }}\n\n<revision>\nRevise Instruct: {{ $('M-Instruct').isExecuted ? $('M-Instruct').item.json.revise_instruct : $('T-Instruct').isExecuted ? $('T-Instruct').item.json.revise_instruct : 'n/a' }}\nRevised Brief ID: {{ $('M-Instruct').isExecuted ? $('M-Instruct').item.json.revised_brief_id : $('T-Instruct').isExecuted ? $('T-Instruct').item.json.revised_brief_id : 'n/a'}}\n</revision>\n\n<post_instruct>\nPlatform: {{ $('Marcus Webhook').isExecuted ? $('Marcus Webhook').item.json.body.platform : $('M-Instruct').isExecuted ? $('M-Instruct').item.json.platform : $('T-Instruct').item.json.platform }}\nContent type: {{ $('Marcus Webhook').isExecuted ? $('Marcus Webhook').item.json.body.content_type : '' }}\nTopic: {{ $('Marcus Webhook').isExecuted ? $('Marcus Webhook').item.json.body.topic_hint : '' }}\nTone: {{ $('Marcus Webhook').isExecuted ? $('Marcus Webhook').item.json.body.tone_strategy : '' }}\nApproved Angle: {{ $('Marcus Webhook').isExecuted ? $('Marcus Webhook').item.json.body.post_angle : '' }}\n</post_instruct>\n\n<client>\nClient: {{ $('Marcus Webhook').isExecuted ? $('Marcus Webhook').item.json.body.client : $('M-Instruct').isExecuted ? $('M-Instruct').item.json.client : $('T-Instruct').item.json.client }}\nProduct: {{ $('Marcus Webhook').isExecuted ? $('Marcus Webhook').item.json.body.product : $json.product }}\nVisual Style: {{ $('Marcus Webhook').isExecuted ? $('Marcus Webhook').item.json.body.visual_style : $json.visual_style }}\nKey Message: {{ $('Marcus Webhook').isExecuted ? $('Marcus Webhook').item.json.body.key_message : $json.key_messages }}\nLanguage Avoid: {{ $('Marcus Webhook').isExecuted ? $('Marcus Webhook').item.json.body.language_avoid : $json.language_avoid }}\nBANNED WORDS: The terms in Language Avoid must never appear in post_text. If you catch yourself using one, rewrite the sentence before continuing.\n</client>\n\n<social_media_style>\nSocial Tone: {{ $('Edit Fields').isExecuted ? $json.tone : '' }}\nHook Formulas: {{ $('Edit Fields').isExecuted ? $json.hook_formulas : '' }}\nSpecs: {{ $('Edit Fields').isExecuted ? $json.specs : '' }}\n</social_media_style>\n\n<tool_call>\n- Tavily: Query: \"top performing [platform] ad visuals [product category] 2026 site:facebook.com/ads/library OR site:adespresso.com\" Extract only: dominant color mood, subject framing, text-on-image placement patterns from high-performing ads in this niche.\n- Read DB: Key is Brief ID. Used when Revision Instruct received.\n</tool_call>\n\n<CTA Info>\nloopin.co | @loopin\n</CTA Info>\n\n# STEP 1 — CHECK REVISION\nCheck Revise Instruct in <revision> block.\n- If Revise Instruct is 'n/a': proceed to STEP 2.\n- If Revise Instruct is NOT 'n/a':\n  a) Call Read DB tool using Brief ID. Read: content_type, approved_angle, post_text, image_prompt. post_text and image_prompt are your previous iterations.\n  b) REWRITE post_text per any Revise Instruct in <revision>\n  c) REWRITE image_prompt with STEP 4 rules, per any Revise Instruct in <revision>\n  d) Proceed to OUTPUT\n\n# STEP 2 — WRITE COPY (fresh runs only)\n## post_text\n- <post_instruct> is your primary guideline\n- You are writing for the <client>\n- Use <social_media_style> Specs to maintain structure. Use Hook Formulas to create early hook.\n- If CTA indicated in Specs: add punchy CTA using one value from <CTA Info>.\n- If hashtags indicated in Specs: use trending relevant tags to the Product.\n- BANNED WORDS must not appear. See <client>.\n\n# STEP 3 — VISUAL RESEARCH\n- Call Tavily once using the query in <tool_call>. Adapt [platform] and [product category] to the query.\n- Extract only: dominant color mood, subject framing, text-on-image placement patterns.\nYour Tavily findings are a primary creative reference for scene composition. \n\n# STEP 4 — BUILD image_prompt\nConstruct in this exact order:\n1. SCENE: Main subject + environment + lighting + camera angle + mood.\n- Apply Visual Style from <client> + Tavily findings. Make it unique and eye-catching.\n- What made those ads stop the scroll? Recreate that energy for this client's product.\n- Think magazine cover, NOT stock photo.Editorially bold. Dramatic lighting contrast, strong foreground subject, shallow depth of field. \n- Specify exact lens feel: e.g. 85mm portrait, 35mm wide, 50mm natural.\n- Single image only. No split-screen, no before/after.\n- AVOID complex words or symbols on screens.\n- AVOID screens, phones, tablets facing the wrong way. If used, prompt for correct facing.\n\n2. TEXT OVERLAY — HOOK: Upper third of image. Use client's Visual Style.\n   - 2–4 words ONLY, lifted from post hook.\n   - Specify exactly: font, colors, position, and quoted text.\n\n3. TEXT OVERLAY — SITE | MENTION: Lower-right corner. One of: loopin.co | @loopin.\n   - Apply Visual Style for font and color.\n   - Specify exactly: font, colors, position, and quoted text.\n\n# OUTPUT\n## BRIEF ID RULE\n- If is_revision = false → use Brief ID from <revision> block.\n- If is_revision = true → use Revised Brief ID from <revision> block.\n\n## PASS THROUGH\napproved_angle, client, platform, content_type\n\nReturn ONLY the raw JSON object defined in your system prompt.",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "You are Marcus AI, a senior social media creative at Relay.\nYou write platform-native post copy and precise image generation prompts for single-image ads. You write for conversion.\n\nSCOPE: One post per run. Copy and image prompt only.\n\nTOOLS\n1. Read DB — call ONLY when Revise Instruct ≠ 'n/a'. Use brief_id.\n2. Tavily — call ONCE per run. Visual research only. Never more than once.\n\nOUTPUT CONTRACT\nReturn ONLY raw valid JSON — no markdown, no preamble, no explanation.\n{\n  \"post_text\": \"\",\n  \"image_prompt\": \"\",\n  \"brief_id\": \"\",\n  \"is_revision\": false,\n  \"approved_angle\": \"\",\n  \"client\": \"\",\n  \"platform\": \"\",\n  \"content_type\": \"\"\n}",
          "maxIterations": 6,
          "returnIntermediateSteps": false
        }
      },
      "id": "006572c8-e97b-4968-943e-3cef0cf446e6",
      "name": "Marcus AI",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -2176,
        2144
      ],
      "retryOnFail": false,
      "typeVersion": 1.7,
      "executeOnce": true,
      "maxTries": 2,
      "waitBetweenTries": 4000
    },
    {
      "parameters": {
        "resume": "form",
        "formTitle": "🎨 Marcus - Content Post for Review",
        "formDescription": "=-RELAY-\nMARCUS AI content for: {{ $('Marcus AI').item.json.output.brief_id }} · {{ $('Marcus AI').item.json.output.platform }} · {{ $('Marcus AI').item.json.output.content_type }}\n\n\nProposed:\n<h3>Post Text:</h3> {{ $('Marcus AI').item.json.output.post_text }}\n---\n<img src=\"{{ $('Flux').item.json.images[0].url }}\" width=\"350\">\n     \nApprove and send to Taylor, or revsie to Marcus AI",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Decision",
              "fieldType": "dropdown",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Approved"
                  },
                  {
                    "option": "Revise"
                  },
                  {
                    "option": "Canceled"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldLabel": "Approve Note",
              "fieldType": "textarea",
              "placeholder": "Why the approved angle?"
            },
            {
              "fieldLabel": "Revise Note",
              "fieldType": "textarea",
              "placeholder": "Instruct to Marcus AI for revision"
            }
          ]
        },
        "limitWaitTime": true,
        "resumeAmount": 8,
        "options": {}
      },
      "id": "b7fb7621-9863-486f-8bca-3b3848338d9f",
      "name": "Approve Form1",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -1104,
        2144
      ],
      "webhookId": "sofia-approval"
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "C0B5JFMJK6E",
          "mode": "id"
        },
        "text": "=🎨 MARCUS: Approval received 👍 sending {{ $json.brief_id }} to Taylor!",
        "otherOptions": {}
      },
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.4,
      "position": [
        -256,
        1840
      ],
      "id": "3e2395d9-4995-4ae2-bb8a-57ece930d16d",
      "name": "Approved Mssg1",
      "webhookId": "d8df9fec-b77a-45fb-b8d1-458de15985ab",
      "credentials": {
        "slackApi": {
          "id": "V3dfJrNTD6Y86lSH",
          "name": "Slack 2"
        }
      }
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "C0B5JFMJK6E",
          "mode": "id"
        },
        "text": "=🎨 MARCUS: Notice Post Content {{ $('Marcus AI').item.json.output.brief_id }} has been duly cancelled",
        "otherOptions": {}
      },
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.4,
      "position": [
        -256,
        2432
      ],
      "id": "69df9f9a-ed62-4865-ad9e-72e13fdf9103",
      "name": "Cancelled Mssg1",
      "webhookId": "d8df9fec-b77a-45fb-b8d1-458de15985ab",
      "credentials": {
        "slackApi": {
          "id": "V3dfJrNTD6Y86lSH",
          "name": "Slack 2"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "55d136e4-dd68-44aa-b746-068421f4bd0e",
              "leftValue": "={{ $('Marcus AI').item.json.output.is_revision }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        -1392,
        2144
      ],
      "id": "df918517-7f41-4946-b3cf-653e182cb8ef",
      "name": "If Revision1"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8",
          "mode": "list",
          "cachedResultName": "Ad_Pipeline_v2",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 780992481,
          "mode": "list",
          "cachedResultName": "Post Content",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit#gid=780992481"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": 0,
            "content_status": "Cancelled",
            "brief_id": "={{ $('Marcus AI').item.json.last().brief_id }}"
          },
          "matchingColumns": [
            "brief_id"
          ],
          "schema": [
            {
              "id": "brief_id",
              "displayName": "brief_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "created_at",
              "displayName": "created_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "approved_angle",
              "displayName": "approved_angle",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "client",
              "displayName": "client",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "platform",
              "displayName": "platform",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "content_type",
              "displayName": "content_type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "post_text",
              "displayName": "post_text",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "image_prompt",
              "displayName": "image_prompt",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "format",
              "displayName": "format",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "image_1",
              "displayName": "image_1",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "image_2",
              "displayName": "image_2",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "image_3",
              "displayName": "image_3",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "carousel_slide_count",
              "displayName": "carousel_slide_count",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "carousel_json",
              "displayName": "carousel_json",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "approve_note",
              "displayName": "approve_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "marcus_revise_note",
              "displayName": "marcus_revise_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "taylor_revise_note",
              "displayName": "taylor_revise_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "rejected_by_stage",
              "displayName": "rejected_by_stage",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "content_status",
              "displayName": "content_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "31ae0671-c858-4927-93ab-65e8bd352cfc",
      "name": "DB -  Log Cancel1",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -464,
        2432
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "CjB4pVPhUNjDvDTe",
          "name": "DS Ggl Sheet"
        }
      },
      "notes": "approved output → write approval to Strategy tab then pass to Marcus leg"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json['Decision'] }}",
                    "rightValue": "Approved",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "c9cd561c-989b-4746-ab86-e0e3cc409954"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "approve"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json['Decision'] }}",
                    "rightValue": "Revise",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "83e486f2-7912-43dd-8683-39b1e5a8c1bc"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "revise"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "f19930ce-73d0-4741-89f7-c01d1fbab7d6",
                    "leftValue": "={{ $json['Decision'] }}",
                    "rightValue": "Canceled",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "cancel"
            }
          ]
        },
        "options": {}
      },
      "id": "46951213-8774-4e33-a584-717f588d57fe",
      "name": "Route Decision1",
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        -752,
        2128
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://n8n.airpg.ai/webhook/Marcus",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "brief_id",
              "value": "={{ $('OBJECTS Sofia').item.json.output.brief_id }}"
            },
            {
              "name": "approved_angle",
              "value": "={{ $('Approve Form').item.json['Approved Angle'] }}"
            },
            {
              "name": "post_angle",
              "value": "={{ $('OBJECTS Sofia').item.json.output['post_angle_' + $('Approve Form').item.json['Approved Angle']] }}"
            },
            {
              "name": "client",
              "value": "={{ $('OBJECTS Sofia').item.json.client }}"
            },
            {
              "name": "platform",
              "value": "={{ $('OBJECTS Sofia').item.json.platform }}"
            },
            {
              "name": "content_type",
              "value": "={{ $('OBJECTS Sofia').item.json.content_type }}"
            },
            {
              "name": "topic_hint",
              "value": "={{ $('OBJECTS Sofia').item.json.topic_hint }}"
            },
            {
              "name": "tone_strategy",
              "value": "={{ $('OBJECTS Sofia').item.json.tone_note }}"
            },
            {
              "name": "product",
              "value": "={{ $('Generate brief_id').item.json.product }}"
            },
            {
              "name": "visual_style",
              "value": "={{ $('Generate brief_id').item.json.visual_style }}"
            },
            {
              "name": "key_message",
              "value": "={{ $('Generate brief_id').item.json.key_messages }}"
            },
            {
              "name": "language_avoid",
              "value": "={{ $('Generate brief_id').item.json.language_avoid }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        -64,
        1104
      ],
      "id": "c7dd4c72-cd14-4b13-b5d4-fbbf2cc7b439",
      "name": "To Marcus"
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"ai_summary\": {\n      \"type\": \"string\",\n      \"description\": \"2-3 sentence summary of post and image quality.\"\n    },\n    \"ai_quality_flags\": {\n      \"type\": \"string\",\n      \"description\": \"Comma-separated list of violations found. 'none' if clean.\"\n    },\n    \"ai_recommendation\": {\n      \"type\": \"string\",\n      \"description\": \"Approve or Revise only.\"\n    }\n  },\n  \"required\": [\"ai_summary\", \"ai_quality_flags\", \"ai_recommendation\"]\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        -1680,
        3200
      ],
      "id": "7df0da5f-54e7-4c90-9490-57512f6dc58f",
      "name": "parse1"
    },
    {
      "parameters": {
        "resume": "form",
        "formTitle": "👑 Taylor AI - Post for Approval",
        "formDescription": "=-RELAY-\n<h3>Post complete for:</h3> {{ $('Taylor Webhook').item.json.body.client }} · {{ $('Taylor Webhook').item.json.body.platform }} · {{ $('Taylor Webhook').item.json.body.brief_id }}\n\n<h3>Taylor AI recommends:</h3>\n{{ $json.output.ai_recommendation }}\n\n<h3>AI Summary:</h3> {{ $json.output.ai_summary }}\n\n\n<h3>Tags:</h3> {{ $json.output.ai_quality_flags }}\n\n<h3>POST:</h3>\n{{ $('Taylor Webhook').item.json.body.post }}\n<img src=\"{{ $('Taylor Webhook').item.json.body.media }}\" width=\"350\">",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Decision",
              "fieldType": "dropdown",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Approved"
                  },
                  {
                    "option": "Revise"
                  },
                  {
                    "option": "Canceled"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldLabel": "Approve Note",
              "fieldType": "textarea",
              "placeholder": "Why  approved?"
            },
            {
              "fieldLabel": "Revise Note",
              "fieldType": "textarea",
              "placeholder": "Instruct to team for revision"
            },
            {
              "fieldLabel": "Send Back To",
              "fieldType": "dropdown",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Marcus"
                  },
                  {
                    "option": "Sofia"
                  }
                ]
              }
            }
          ]
        },
        "limitWaitTime": true,
        "resumeAmount": 8,
        "options": {}
      },
      "id": "20a064f4-57ad-41f2-9c4a-0f3d9718033f",
      "name": "Approve Form2",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -1408,
        3008
      ],
      "webhookId": "sofia-approval"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json['Decision'] }}",
                    "rightValue": "Approved",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "c9cd561c-989b-4746-ab86-e0e3cc409954"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Approved"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json['Decision'] }}",
                    "rightValue": "Revise",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "83e486f2-7912-43dd-8683-39b1e5a8c1bc"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "revise"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "f19930ce-73d0-4741-89f7-c01d1fbab7d6",
                    "leftValue": "={{ $json['Decision'] }}",
                    "rightValue": "Canceled",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "cancel"
            }
          ]
        },
        "options": {}
      },
      "id": "ce911e04-c580-4b30-8b74-d16e545e2682",
      "name": "Route Decision2",
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        -1136,
        2992
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "Marcus",
        "responseMode": "lastNode",
        "responseData": "allEntries",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        -2816,
        2144
      ],
      "id": "97aed425-7adf-4b1f-8cc8-75bd0b4bd437",
      "name": "Marcus Webhook",
      "webhookId": "a6cd05de-0922-4d4c-88ce-d3fc93ce9e1e"
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "Taylor",
        "responseMode": "lastNode",
        "responseData": "allEntries",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        -2112,
        3008
      ],
      "id": "790b4a9a-caa3-4c10-9ac3-f6973d30b182",
      "name": "Taylor Webhook",
      "webhookId": "a6cd05de-0922-4d4c-88ce-d3fc93ce9e1e"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Client: {{ $json.body.client }}\nPlatform: {{ $json.body.platform }}\nPost Text: {{ $json.body.post }}\nMedia: {{ $json.body.media }}\n# STEP 1 — GET CLIENT DATA\nCall Get Client for {{ $json.body.client }}. Read all columns.\n\n# STEP 2 — REVIEW IMAGE\nView the Media at the Media URL above. Evaluate against visual_style from client data: real people, natural light, clean backgrounds, correct brand colors, correct typography, no stock clichés, no suits, no staged meetings. Note any violations.\n\n# STEP 3 — REVIEW COPY\nEvaluate Post Text against: brand_voice, the correct platform tone for {{ $json.body.platform }}, key_messages, and language_avoid. Check hook strength, CTA presence, word count fit for platform, and any banned language.\nAlso evaluate the hook and copy angle against your knowledge of high-performing {{ $json.body.platform }} B2B SaaS content in 2026. Flag if the approach feels dated or generic.\n\n# STEP 4 — OUTPUT\nai_summary: 2-3 sentences covering what the post does well and what the image delivers. ai_quality_flags: comma-separated list of any violations found in copy or image. If none write \"none\". \nai_recommendation: \"Approve\" if no major flags. \"Revise\" if copy or image has a brand, tone, or quality violation.\n\nReturn ONLY the raw JSON object defined in your system prompt.",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "SCOPE\nOne post review per run. You evaluate copy and image together. Nothing outside that.\n\nTOOLS\nGet Client Data — call first, every run.\n\nOUTPUT CONTRACT\nReturn ONLY raw valid JSON. No markdown, no explanation, no preamble, no postamble.\n\n{\n\"ai_summary\": \"\", \n\"ai_quality_flags\": \"\", \n\"ai_recommendation\": \"\"\n}\n\nai_recommendation is ONLY \"Approve\" or \"Revise\". No other values accepted.",
          "maxIterations": 6,
          "returnIntermediateSteps": false
        }
      },
      "id": "200f01b3-6e27-4dc7-91da-f0a929efff0c",
      "name": "Taylor AI",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1840,
        3008
      ],
      "retryOnFail": false,
      "typeVersion": 1.7,
      "executeOnce": true,
      "maxTries": 2,
      "waitBetweenTries": 4000
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://n8n.airpg.ai/webhook/Taylor",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "brief_id",
              "value": "={{ $('Marcus AI').item.json.output.brief_id }}"
            },
            {
              "name": "client",
              "value": "={{ $('Marcus AI').item.json.output.client }}"
            },
            {
              "name": "platform",
              "value": "={{ $('Marcus AI').item.json.output.platform }}"
            },
            {
              "name": "post",
              "value": "={{ $('Marcus AI').item.json.output.post_text }}"
            },
            {
              "name": "media",
              "value": "={{ $('Flux').item.json.images[0].url }}"
            },
            {
              "name": "approve_note",
              "value": "={{ $('Approve Form1').item.json['Approve Note'] }}"
            },
            {
              "name": "created_at",
              "value": "={{ $now }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        -64,
        1840
      ],
      "id": "e945b3b8-ec28-4322-8e08-d48022fce41a",
      "name": "To Taylor"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "b93a90b0-352e-4b65-9562-b40ebc535c16",
              "name": "revise_instruct",
              "value": "=Attention, your last post angles were declined. Here is your instuct: {{ $('Approve Form').item.json['Revise Note'] }}",
              "type": "string"
            },
            {
              "id": "09ba8cea-e4dd-47f7-a01f-d24fcef6def7",
              "name": "brief_id",
              "value": "={{ $('OBJECTS Sofia').last().json.output.brief_id }}",
              "type": "string"
            },
            {
              "id": "ffa866bf-f731-4441-a5df-1f829e4d580d",
              "name": "revised_brief_id",
              "value": "={{ $json.brief_id.replace(/-(\\d+)$/, (match, p1) => '-' + String(Number(p1) + 1).padStart(p1.length, '0')) }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -256,
        1312
      ],
      "id": "9c1dbab2-a775-4f54-b89d-5b169aabadfb",
      "name": "Revise Instruct"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8",
          "mode": "list",
          "cachedResultName": "Ad_Pipeline_v2",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 2027252897,
          "mode": "list",
          "cachedResultName": "Strategy",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit#gid=2027252897"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "post_angle_2": "={{ $json.output.post_angle_2 }}",
            "post_angle_3": "={{ $json.output.post_angle_3 }}",
            "brief_id": "={{ $('OBJECTS Sofia').item.json.output.brief_id }}",
            "submitted_at": "={{ $now }}",
            "client": "={{ $('Parse — Brief Fields').item.json.Client }}",
            "platform": "={{ $('Parse — Brief Fields').item.json.Platform }}",
            "content_type": "={{ $('Parse — Brief Fields').item.json['Content Type'] }}",
            "topic_hint": "={{ $('Parse — Brief Fields').item.json['Topic Hint'] }}",
            "tone_note": "={{ $('Parse — Brief Fields').item.json['Tone Note'] }}",
            "post_angle_1": "={{ $json.output.post_angle_1 }}"
          },
          "matchingColumns": [
            "revision_id"
          ],
          "schema": [
            {
              "id": "brief_id",
              "displayName": "brief_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "submitted_at",
              "displayName": "submitted_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "client",
              "displayName": "client",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "platform",
              "displayName": "platform",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "content_type",
              "displayName": "content_type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "topic_hint",
              "displayName": "topic_hint",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "tone_note",
              "displayName": "tone_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "post_angle_1",
              "displayName": "post_angle_1",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "post_angle_2",
              "displayName": "post_angle_2",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "post_angle_3",
              "displayName": "post_angle_3",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "approved_angle",
              "displayName": "approved_angle",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "approve_note",
              "displayName": "approve_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "revise_note",
              "displayName": "revise_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "rejected_by_stage",
              "displayName": "rejected_by_stage",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "strategy_status",
              "displayName": "strategy_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "4e8b5837-bf99-4ec5-9165-de394a14a252",
      "name": "DB - Log Revised Posts",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -1296,
        1136
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "CjB4pVPhUNjDvDTe",
          "name": "DS Ggl Sheet"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8",
          "mode": "list",
          "cachedResultName": "Ad_Pipeline_v2",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 2027252897,
          "mode": "list",
          "cachedResultName": "Strategy",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit#gid=2027252897"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": 0,
            "strategy_status": "Revise",
            "revise_note": "={{ $('Approve Form').item.json['Revise Note'] }}",
            "brief_id": "={{ $('OBJECTS Sofia').last().json.output.brief_id }}"
          },
          "matchingColumns": [
            "brief_id"
          ],
          "schema": [
            {
              "id": "brief_id",
              "displayName": "brief_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "submitted_at",
              "displayName": "submitted_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "client",
              "displayName": "client",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "platform",
              "displayName": "platform",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "content_type",
              "displayName": "content_type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "topic_hint",
              "displayName": "topic_hint",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "tone_note",
              "displayName": "tone_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "post_angle_1",
              "displayName": "post_angle_1",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "post_angle_2",
              "displayName": "post_angle_2",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "post_angle_3",
              "displayName": "post_angle_3",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "approved_angle",
              "displayName": "approved_angle",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "approve_note",
              "displayName": "approve_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "revise_note",
              "displayName": "revise_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "rejected_by_stage",
              "displayName": "rejected_by_stage",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "strategy_status",
              "displayName": "strategy_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "1c2cd8b9-6c36-409d-85fc-b1829df5e2ab",
      "name": "DB - Log Revise Instruct",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -480,
        1312
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "CjB4pVPhUNjDvDTe",
          "name": "DS Ggl Sheet"
        }
      },
      "notes": "approved output → write approval to Strategy tab then pass to Marcus leg"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "28332301-d011-4054-aefd-09f678e9d925",
              "name": "output.post_angle_1",
              "value": "={{ $json.output.post_angle_1 }}",
              "type": "string"
            },
            {
              "id": "a6747d67-6682-4bf0-a547-4ef6b9cf8a9d",
              "name": "output.post_angle_2",
              "value": "={{ $json.output.post_angle_2 }}",
              "type": "string"
            },
            {
              "id": "fc8231a5-51dc-4639-b3ef-a771b3d61cc5",
              "name": "output.post_angle_3",
              "value": "={{ $json.output.post_angle_3 }}",
              "type": "string"
            },
            {
              "id": "1354a703-a3b0-4009-aa49-5c4ef1176b77",
              "name": "output.brief_id",
              "value": "={{ $json.output.brief_id }}",
              "type": "string"
            },
            {
              "id": "34da225e-62a9-454e-b976-ef0bce1a8fa9",
              "name": "output.is_revision",
              "value": "={{ $json.output.is_revision }}",
              "type": "boolean"
            },
            {
              "id": "d692a765-d4a4-494d-8a6f-defe4d0b42d7",
              "name": "client",
              "value": "={{ $('Generate brief_id').item.json.client }}",
              "type": "string"
            },
            {
              "id": "97899f9f-0e69-4aeb-be24-e5766eefc17e",
              "name": "platform",
              "value": "={{ $('Generate brief_id').item.json.platform }}",
              "type": "string"
            },
            {
              "id": "fd265c3b-7f5c-4167-9927-580011bcc13c",
              "name": "content_type",
              "value": "={{ $('Generate brief_id').item.json.content_type }}",
              "type": "string"
            },
            {
              "id": "274a8bfe-6cc9-498e-9cbc-c05768712532",
              "name": "topic_hint",
              "value": "={{ $('Generate brief_id').item.json.topic_hint }}",
              "type": "string"
            },
            {
              "id": "676530d5-62ce-490e-bba1-17a9806dde91",
              "name": "tone_note",
              "value": "={{ $('Generate brief_id').item.json.tone_note }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -1792,
        1296
      ],
      "id": "38daf002-6ef7-44a3-92fa-7ad440cd6e78",
      "name": "OBJECTS Sofia"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8",
          "mode": "list",
          "cachedResultName": "Ad_Pipeline_v2",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 2027252897,
          "mode": "list",
          "cachedResultName": "Strategy",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit#gid=2027252897"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "post_angle_2": "={{ $('OBJECTS Sofia').item.json.output.post_angle_2 }}",
            "post_angle_3": "={{ $('OBJECTS Sofia').item.json.output.post_angle_3 }}",
            "brief_id": "={{ $('OBJECTS Sofia').item.json.output.brief_id }}",
            "submitted_at": "={{ $now }}",
            "post_angle_1": "={{ $('OBJECTS Sofia').item.json.output.post_angle_1 }}",
            "row_number": 0
          },
          "matchingColumns": [
            "brief_id"
          ],
          "schema": [
            {
              "id": "brief_id",
              "displayName": "brief_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "submitted_at",
              "displayName": "submitted_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "client",
              "displayName": "client",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "platform",
              "displayName": "platform",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "content_type",
              "displayName": "content_type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "topic_hint",
              "displayName": "topic_hint",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "tone_note",
              "displayName": "tone_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "post_angle_1",
              "displayName": "post_angle_1",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "post_angle_2",
              "displayName": "post_angle_2",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "post_angle_3",
              "displayName": "post_angle_3",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "approved_angle",
              "displayName": "approved_angle",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "approve_note",
              "displayName": "approve_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "revise_note",
              "displayName": "revise_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "rejected_by_stage",
              "displayName": "rejected_by_stage",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "strategy_status",
              "displayName": "strategy_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "e962361f-3833-4f45-a6e1-2d2e1873a280",
      "name": "DB - Upsert New Posts",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -1296,
        1312
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "CjB4pVPhUNjDvDTe",
          "name": "DS Ggl Sheet"
        }
      }
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "C0B5JFMJK6E",
          "mode": "id"
        },
        "text": "=🎯 SOFIA: Sofia AI has REVISED 3 post angles for {{ $('DB - Upsert New Posts').item.json.brief_id }}\nReview limit 8 hrs\n\nReview and pick one here 👇\n<{{$execution.resumeFormUrl}}|Open STRATEGY Review Form>",
        "otherOptions": {
          "unfurl_links": true
        }
      },
      "id": "d7806f9f-6446-4a84-9301-4a053d143c85",
      "name": "Post Angles REVISED",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.3,
      "position": [
        -1008,
        944
      ],
      "webhookId": "8bb971c4-baa8-44b2-a6bf-2e2a800fb8ef",
      "credentials": {
        "slackApi": {
          "id": "V3dfJrNTD6Y86lSH",
          "name": "Slack 2"
        }
      }
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "C0B5JFMJK6E",
          "mode": "id"
        },
        "text": "=🎯 SOFIA: Sofia AI has proposed 3 post angles for {{ $('DB - Upsert New Posts').item.json.brief_id }}\nReview limit 8 hrs\n\nReview and pick one here 👇\n<{{$execution.resumeFormUrl}}|Open STRATEGY Review Form>",
        "otherOptions": {
          "unfurl_links": true
        }
      },
      "id": "6ca72419-557d-49d9-a9c7-ad25608efcd1",
      "name": "Post Angles new",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.3,
      "position": [
        -1008,
        1120
      ],
      "webhookId": "8bb971c4-baa8-44b2-a6bf-2e2a800fb8ef",
      "credentials": {
        "slackApi": {
          "id": "V3dfJrNTD6Y86lSH",
          "name": "Slack 2"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        -2304,
        2368
      ],
      "id": "b3a750b1-6caa-4431-bf46-2faeda08a783",
      "name": "Google Gemini Chat Model",
      "retryOnFail": true,
      "credentials": {
        "googlePalmApi": {
          "id": "2qUzA3DAEFRc7DI1",
          "name": "Gemini FRAINK key"
        }
      }
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "C0B5JFMJK6E",
          "mode": "id"
        },
        "text": "=🎨 MARCUS: Marcus AI REVISED Post Content for {{ $('Marcus AI').last().json.output.brief_id }}\nReview limit 8 hrs\n\nReview here 👇\n<{{$execution.resumeFormUrl}}|Open CONTENT Review Form>",
        "otherOptions": {}
      },
      "id": "ea35cfb3-b91e-4489-8bb1-886a234bd9ea",
      "name": "Content Revised Mssg",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.3,
      "position": [
        -1104,
        1808
      ],
      "webhookId": "8bb971c4-baa8-44b2-a6bf-2e2a800fb8ef",
      "credentials": {
        "slackApi": {
          "id": "V3dfJrNTD6Y86lSH",
          "name": "Slack 2"
        }
      }
    },
    {
      "parameters": {
        "toolDescription": "Visual research tool. Use to search for top-performing ad visuals by niche and platform. Extract: color mood, subject framing, text-on-image placement patterns. One call per run only.",
        "method": "POST",
        "url": "https://api.tavily.com/search",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"query\": \"{{ $fromAI('query', '', 'string') }}\",\n  \"search_depth\": \"basic\",\n  \"include_raw_content\": false,\n  \"include_answer\": false,\n  \"max_results\": 10,\n  \"exclude_domains\": [\"nytimes.com\", \"bloomberg.com\", \"wsj.com\", \"washingtonpost.com\", \"theathletic.com\"]\n}",
        "options": {
          "allowUnauthorizedCerts": true
        }
      },
      "type": "n8n-nodes-base.httpRequestTool",
      "typeVersion": 4.4,
      "position": [
        -2176,
        2368
      ],
      "id": "632c3e1c-8b28-458c-9a53-4bc9c2efe86d",
      "name": "Tavily",
      "credentials": {
        "httpHeaderAuth": {
          "id": "HgRwbVZRTb5iGakb",
          "name": "Tavily"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8",
          "mode": "list",
          "cachedResultName": "Ad_Pipeline_v2",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 780992481,
          "mode": "list",
          "cachedResultName": "Post Content",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit#gid=780992481"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "brief_id": "={{ $('Marcus AI').item.json.output.brief_id }}",
            "client": "={{ $('Marcus AI').item.json.output.client}}",
            "platform": "={{ $('Marcus AI').item.json.output.platform}}",
            "content_type": "={{ $('Marcus AI').item.json.output.content_type}}",
            "post_text": "={{ $('Marcus AI').item.json.output.post_text }}",
            "image_prompt": "={{ $('Marcus AI').item.json.output.image_prompt }}",
            "format": "single_image",
            "created_at": "={{ $now }}",
            "image_1": "={{ $json.images[0].url }}",
            "approved_angle": "={{ $('Marcus AI').item.json.output.approved_angle}}"
          },
          "matchingColumns": [
            "revision_id"
          ],
          "schema": [
            {
              "id": "brief_id",
              "displayName": "brief_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "created_at",
              "displayName": "created_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "approved_angle",
              "displayName": "approved_angle",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "client",
              "displayName": "client",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "platform",
              "displayName": "platform",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "content_type",
              "displayName": "content_type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "post_text",
              "displayName": "post_text",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "image_prompt",
              "displayName": "image_prompt",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "format",
              "displayName": "format",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "image_1",
              "displayName": "image_1",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "image_2",
              "displayName": "image_2",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "image_3",
              "displayName": "image_3",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "carousel_slide_count",
              "displayName": "carousel_slide_count",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "carousel_json",
              "displayName": "carousel_json",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "approve_note",
              "displayName": "approve_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "marcus_revise_note",
              "displayName": "marcus_revise_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "taylor_revise_note",
              "displayName": "taylor_revise_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "rejected_by_stage",
              "displayName": "rejected_by_stage",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "content_status",
              "displayName": "content_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {
          "cellFormat": "RAW"
        }
      },
      "id": "2cef8ecd-adb9-4c84-91d8-2975927d4580",
      "name": "DB - Log Content",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -1616,
        2144
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "CjB4pVPhUNjDvDTe",
          "name": "DS Ggl Sheet"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8",
          "mode": "list",
          "cachedResultName": "Ad_Pipeline_v2",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 780992481,
          "mode": "list",
          "cachedResultName": "Post Content",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit#gid=780992481"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": 0,
            "content_status": "Approved",
            "brief_id": "={{ $('Marcus AI').last().json.output.brief_id }}",
            "approve_note": "={{ $('Approve Form1').item.json['Approve Note'] }}"
          },
          "matchingColumns": [
            "brief_id"
          ],
          "schema": [
            {
              "id": "brief_id",
              "displayName": "brief_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "created_at",
              "displayName": "created_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "approved_angle",
              "displayName": "approved_angle",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "client",
              "displayName": "client",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "platform",
              "displayName": "platform",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "content_type",
              "displayName": "content_type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "post_text",
              "displayName": "post_text",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "image_prompt",
              "displayName": "image_prompt",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "format",
              "displayName": "format",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "image_1",
              "displayName": "image_1",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "image_2",
              "displayName": "image_2",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "image_3",
              "displayName": "image_3",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "carousel_slide_count",
              "displayName": "carousel_slide_count",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "carousel_json",
              "displayName": "carousel_json",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "approve_note",
              "displayName": "approve_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "marcus_revise_note",
              "displayName": "marcus_revise_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "taylor_revise_note",
              "displayName": "taylor_revise_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "rejected_by_stage",
              "displayName": "rejected_by_stage",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "content_status",
              "displayName": "content_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "23f9152e-81d8-48b7-ba6c-e123cbab7f87",
      "name": "DB -  Log Approval",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -464,
        1840
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "CjB4pVPhUNjDvDTe",
          "name": "DS Ggl Sheet"
        }
      },
      "notes": "approved output → write approval to Strategy tab then pass to Marcus leg"
    },
    {
      "parameters": {
        "content": "## Cancel",
        "height": 80,
        "width": 320,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        3312
      ],
      "typeVersion": 1,
      "id": "8e68ed0a-afb4-4c1a-bbd6-7eab32bdb78b",
      "name": "Sticky Note3"
    },
    {
      "parameters": {
        "content": "## Approved",
        "height": 112,
        "width": 320,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        2704
      ],
      "typeVersion": 1,
      "id": "3f4a9d5e-26bd-4811-85be-d93d9d9203ad",
      "name": "Sticky Note12"
    },
    {
      "parameters": {
        "content": "## Revise",
        "height": 272,
        "width": 320,
        "color": "#4A4B11"
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        2912
      ],
      "typeVersion": 1,
      "id": "de7f759c-ca05-4339-883a-1a3f57dcbf00",
      "name": "Sticky Note13"
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Get row(s) in sheet in Google Sheets. Client Data.",
        "documentId": {
          "__rl": true,
          "value": "1xj7qATHD-qM-bzEFkThkW1wDo_c9SMVbsnsBwNA5RX0",
          "mode": "list",
          "cachedResultName": "Relay-Database",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xj7qATHD-qM-bzEFkThkW1wDo_c9SMVbsnsBwNA5RX0/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 127845294,
          "mode": "list",
          "cachedResultName": "client-database",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xj7qATHD-qM-bzEFkThkW1wDo_c9SMVbsnsBwNA5RX0/edit#gid=127845294"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "client",
              "lookupValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('values0_Value', ``, 'string') }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.7,
      "position": [
        -1792,
        3200
      ],
      "id": "0d53962f-a3f2-42a2-bb93-ebdb22da481b",
      "name": "Get Client",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "CjB4pVPhUNjDvDTe",
          "name": "DS Ggl Sheet"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "7d9befb3-1c24-4978-ad01-52ceedc92bfa",
              "leftValue": "={{ $('Approve Form2').item.json['Send Back To'] }}",
              "rightValue": "Marcus",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        -688,
        3008
      ],
      "id": "a655c7fb-7eba-4076-9119-ce66817f7831",
      "name": "If"
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "C0B5JFMJK6E",
          "mode": "id"
        },
        "text": "= TEAM: 👑 Taylor approved {{ $('Taylor Webhook').item.json.body.brief_id }}!",
        "otherOptions": {}
      },
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.4,
      "position": [
        -480,
        2704
      ],
      "id": "f54a0ae9-a87d-40dc-b38a-4fe7ada27246",
      "name": "👑 Approve Mssg",
      "webhookId": "d8df9fec-b77a-45fb-b8d1-458de15985ab",
      "credentials": {
        "slackApi": {
          "id": "V3dfJrNTD6Y86lSH",
          "name": "Slack 2"
        }
      }
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "C0B5JFMJK6E",
          "mode": "id"
        },
        "text": "=👑 TAYLOR: Notice, Post {{ $('Taylor Webhook').item.json.body.brief_id }} has been duly cancelled",
        "otherOptions": {}
      },
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.4,
      "position": [
        -480,
        3280
      ],
      "id": "60665f41-8c09-41f4-8815-502a5f946868",
      "name": "👑 Cancel Mssg",
      "webhookId": "d8df9fec-b77a-45fb-b8d1-458de15985ab",
      "credentials": {
        "slackApi": {
          "id": "V3dfJrNTD6Y86lSH",
          "name": "Slack 2"
        }
      }
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "C0B5JFMJK6E",
          "mode": "id"
        },
        "text": "=🎨 Taylor to MARCUS: {{ $('Taylor Webhook').item.json.body.brief_id }} needs REVISION! Taylors note: \"{{ $('Approve Form2').item.json['Revise Note'] }}\"\n\nMarcus AI was rebooted, check the review form when ready.\"\n---\n\nTaylor AI's recommendations: {{ $('Taylor AI').item.json.output.ai_summary }} {{ $('Taylor AI').item.json.output.ai_quality_flags }}",
        "otherOptions": {}
      },
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.4,
      "position": [
        -272,
        2928
      ],
      "id": "2514931b-7368-4054-b63e-307515b83171",
      "name": "👑 Revise Mssg Marcus",
      "webhookId": "d8df9fec-b77a-45fb-b8d1-458de15985ab",
      "credentials": {
        "slackApi": {
          "id": "V3dfJrNTD6Y86lSH",
          "name": "Slack 2"
        }
      }
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "C0B5JFMJK6E",
          "mode": "id"
        },
        "text": "=🎯 Taylor to SOFIA: Strategy {{ $('Taylor Webhook').item.json.body.stregy_brief_id }} needs REVISION! \n\nTaylor response: \"{{ $('Approve Form2').item.json['Revise Note'] }}\"\n\n* Please SUBMIT NEW BRIEF via Slack form *\n___\n\nTaylor AI's recommendations: {{ $('Taylor AI').item.json.output.ai_summary }} \n{{ $('Taylor AI').item.json.output.ai_quality_flags }}",
        "otherOptions": {}
      },
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.4,
      "position": [
        -480,
        3088
      ],
      "id": "fe45819d-287f-43cb-bd4b-069ea47db336",
      "name": "👑 Revise Mssg Sofia",
      "webhookId": "d8df9fec-b77a-45fb-b8d1-458de15985ab",
      "credentials": {
        "slackApi": {
          "id": "V3dfJrNTD6Y86lSH",
          "name": "Slack 2"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8",
          "mode": "list",
          "cachedResultName": "Ad_Pipeline_v2",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 1543826274,
          "mode": "list",
          "cachedResultName": "Post Approval",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit#gid=1543826274"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "brief_id": "={{ $('Taylor Webhook').item.json.body.brief_id }}",
            "created_at": "={{ $('Taylor Webhook').item.json.body.created_at }}",
            "client": "={{ $('Taylor Webhook').item.json.body.client }}",
            "platform": "={{ $('Taylor Webhook').item.json.body.platform }}",
            "post": "={{ $('Taylor Webhook').item.json.body.post }}",
            "media": "={{ $('Taylor Webhook').item.json.body.media }}",
            "ai_summary": "={{ $('Taylor AI').item.json.output.ai_summary }}",
            "ai_quality_flags": "={{ $('Taylor AI').item.json.output.ai_quality_flags }}",
            "ai_recommendation": "={{ $('Taylor AI').item.json.output.ai_recommendation }}",
            "approve_note": "={{ $('Approve Form2').item.json['Approve Note'] }}",
            "approval_status": "={{ $('Approve Form2').item.json.Decision }}",
            "sent_back_to": "={{ $('Approve Form2').item.json['Send Back To'] }}",
            "revise_note": "={{ $('Approve Form2').item.json['Revise Note'] }}",
            "status_date": "={{ $now }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "brief_id",
              "displayName": "brief_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "created_at",
              "displayName": "created_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "client",
              "displayName": "client",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "platform",
              "displayName": "platform",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "post",
              "displayName": "post",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "media",
              "displayName": "media",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_summary",
              "displayName": "ai_summary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_quality_flags",
              "displayName": "ai_quality_flags",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_recommendation",
              "displayName": "ai_recommendation",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "revise_note",
              "displayName": "revise_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "sent_back_to",
              "displayName": "sent_back_to",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "approve_note",
              "displayName": "approve_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "publish_date_scheduled",
              "displayName": "publish_date_scheduled",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "published_url",
              "displayName": "published_url",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "status_date",
              "displayName": "status_date",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "approval_status",
              "displayName": "approval_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "992cdb90-5bf0-4daa-8013-0e60c226caf9",
      "name": "👑 DB - Log Revise",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -880,
        3008
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "CjB4pVPhUNjDvDTe",
          "name": "DS Ggl Sheet"
        }
      },
      "notes": "approved output → write approval to Strategy tab then pass to Marcus leg"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8",
          "mode": "list",
          "cachedResultName": "Ad_Pipeline_v2",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 1543826274,
          "mode": "list",
          "cachedResultName": "Post Approval",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit#gid=1543826274"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "brief_id": "={{ $('Taylor Webhook').item.json.body.brief_id }}",
            "created_at": "={{ $('Taylor Webhook').item.json.body.created_at }}",
            "client": "={{ $('Taylor Webhook').item.json.body.client }}",
            "platform": "={{ $('Taylor Webhook').item.json.body.platform }}",
            "post": "={{ $('Taylor Webhook').item.json.body.post }}",
            "media": "={{ $('Taylor Webhook').item.json.body.media }}",
            "ai_summary": "={{ $('Taylor AI').item.json.output.ai_summary }}",
            "ai_quality_flags": "={{ $('Taylor AI').item.json.output.ai_quality_flags }}",
            "ai_recommendation": "={{ $('Taylor AI').item.json.output.ai_recommendation }}",
            "approval_status": "={{ $('Approve Form2').item.json.Decision }}",
            "status_date": "={{ $now  }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "brief_id",
              "displayName": "brief_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "created_at",
              "displayName": "created_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "client",
              "displayName": "client",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "platform",
              "displayName": "platform",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "post",
              "displayName": "post",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "media",
              "displayName": "media",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_summary",
              "displayName": "ai_summary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_quality_flags",
              "displayName": "ai_quality_flags",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_recommendation",
              "displayName": "ai_recommendation",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "revise_note",
              "displayName": "revise_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "sent_back_to",
              "displayName": "sent_back_to",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "approve_note",
              "displayName": "approve_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "publish_date_scheduled",
              "displayName": "publish_date_scheduled",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "published_url",
              "displayName": "published_url",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "status_date",
              "displayName": "status_date",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "approval_status",
              "displayName": "approval_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "45864838-e35a-41ae-80e3-f66c0fa21531",
      "name": "👑 DB - Log Cancelled",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -880,
        3280
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "CjB4pVPhUNjDvDTe",
          "name": "DS Ggl Sheet"
        }
      },
      "notes": "approved output → write approval to Strategy tab then pass to Marcus leg"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8",
          "mode": "list",
          "cachedResultName": "Ad_Pipeline_v2",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 1543826274,
          "mode": "list",
          "cachedResultName": "Post Approval",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit#gid=1543826274"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "brief_id": "={{ $('Taylor Webhook').item.json.body.brief_id }}",
            "created_at": "={{ $('Taylor Webhook').item.json.body.created_at }}",
            "client": "={{ $('Taylor Webhook').item.json.body.client }}",
            "platform": "={{ $('Taylor Webhook').item.json.body.platform }}",
            "post": "={{ $('Taylor Webhook').item.json.body.post }}",
            "media": "={{ $('Taylor Webhook').item.json.body.media }}",
            "ai_summary": "={{ $('Taylor AI').item.json.output.ai_summary }}",
            "ai_quality_flags": "={{ $('Taylor AI').item.json.output.ai_quality_flags }}",
            "ai_recommendation": "={{ $('Taylor AI').item.json.output.ai_recommendation }}",
            "approve_note": "={{ $('Approve Form2').item.json['Approve Note'] }}",
            "approval_status": "={{ $('Approve Form2').item.json.Decision }}",
            "status_date": "={{ $now }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "brief_id",
              "displayName": "brief_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "created_at",
              "displayName": "created_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "client",
              "displayName": "client",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "platform",
              "displayName": "platform",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "post",
              "displayName": "post",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "media",
              "displayName": "media",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_summary",
              "displayName": "ai_summary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_quality_flags",
              "displayName": "ai_quality_flags",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "ai_recommendation",
              "displayName": "ai_recommendation",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "revise_note",
              "displayName": "revise_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "sent_back_to",
              "displayName": "sent_back_to",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "approve_note",
              "displayName": "approve_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "publish_date_scheduled",
              "displayName": "publish_date_scheduled",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "published_url",
              "displayName": "published_url",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "status_date",
              "displayName": "status_date",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "approval_status",
              "displayName": "approval_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "d29d9f8c-79d2-4a2c-86fd-45cab12843c6",
      "name": "👑 DB - Log Approval",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -880,
        2704
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "CjB4pVPhUNjDvDTe",
          "name": "DS Ggl Sheet"
        }
      },
      "notes": "approved output → write approval to Strategy tab then pass to Marcus leg"
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "C0B5JFMJK6E",
          "mode": "id"
        },
        "text": "=👑 TAYLOR: Post Approval pending for {{ $('Taylor Webhook').item.json.body.brief_id }}\n\nReview please 👇\n<{{$execution.resumeFormUrl}}|Open FINAL POST Review Form>",
        "otherOptions": {}
      },
      "id": "d745a456-ce95-468e-a151-061036eafd5c",
      "name": "👑 Slack - Taylor REVIEW",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.3,
      "position": [
        -1408,
        2816
      ],
      "webhookId": "8bb971c4-baa8-44b2-a6bf-2e2a800fb8ef",
      "credentials": {
        "slackApi": {
          "id": "V3dfJrNTD6Y86lSH",
          "name": "Slack 2"
        }
      }
    },
    {
      "parameters": {
        "content": "## Cancel",
        "height": 80,
        "width": 320,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        2448
      ],
      "typeVersion": 1,
      "id": "5304bb21-020e-4879-9971-942296703742",
      "name": "Sticky Note19"
    },
    {
      "parameters": {
        "content": "## Revise",
        "height": 288,
        "width": 320,
        "color": "#4A4B11"
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        2064
      ],
      "typeVersion": 1,
      "id": "2f309324-b02a-416c-a91f-1399c6225943",
      "name": "Sticky Note21"
    },
    {
      "parameters": {
        "content": "## Cancel",
        "height": 80,
        "width": 320,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        1536
      ],
      "typeVersion": 1,
      "id": "18c57756-27af-4a03-ab67-6f2ecb892f60",
      "name": "Sticky Note22"
    },
    {
      "parameters": {
        "content": "## Intake",
        "height": 176,
        "width": 192,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2768,
        688
      ],
      "typeVersion": 1,
      "id": "8244de95-1b83-41f8-8a0d-c02be9673f1e",
      "name": "Sticky Note23"
    },
    {
      "parameters": {
        "content": "## Revise",
        "height": 96,
        "width": 320,
        "color": "#4A4B11"
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        1312
      ],
      "typeVersion": 1,
      "id": "cf54de0a-e02e-49df-bab8-42ffe53a0d6e",
      "name": "Sticky Note24"
    },
    {
      "parameters": {
        "content": "![label](https://media.airpg.ai/marcus.png)",
        "height": 384,
        "width": 416,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -3312,
        2000
      ],
      "id": "22d18334-8b93-4735-b859-afc73f85c377",
      "name": "Sticky Note18"
    },
    {
      "parameters": {
        "content": "![label](https://media.airpg.ai/sofia.png)",
        "height": 320,
        "width": 368,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -3296,
        832
      ],
      "id": "ebcd043e-b583-4719-9132-01fb514aaf41",
      "name": "Sticky Note25"
    },
    {
      "parameters": {
        "content": "![label](https://media.airpg.ai/taylor.png)",
        "height": 336,
        "width": 368,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -3296,
        2896
      ],
      "id": "050ef3c6-f016-418d-bcde-2388489ee703",
      "name": "Sticky Note26"
    },
    {
      "parameters": {
        "content": "# 🎯Sofia Strategy\n## Research and approve Post Angles\n\n## Strategist picks an angle, requests a revision loop, approves an angle send --> Marcus, or cancels.",
        "height": 304,
        "width": 384,
        "color": "#864B57"
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3680,
        848
      ],
      "typeVersion": 1,
      "id": "83523726-8284-48a9-ab02-e18ad3ca8159",
      "name": "Sticky Note11"
    },
    {
      "parameters": {
        "content": "# 👑Taylor Approval\n## Approve Post Content for publication\n\n## Approval Executive reviews final post, requests revisions to --> Marcus or Sofia, approves post for publication, or cancels.",
        "height": 320,
        "width": 400,
        "color": "#715F2D"
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3696,
        2912
      ],
      "typeVersion": 1,
      "id": "1db071da-802f-4e14-a43e-734e0b82011a",
      "name": "Sticky Note14"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "1f7a3cdb-2a7c-43fc-a492-98a08b1be8d8",
              "name": "Client",
              "value": "Loopin",
              "type": "string"
            },
            {
              "id": "a1e9f224-fe78-47e3-8fdb-fb52ee06507c",
              "name": "Platform",
              "value": "LinkedIn",
              "type": "string"
            },
            {
              "id": "d274fdbb-2b2b-445b-a944-8a5d427213a3",
              "name": "Content Type",
              "value": "Product announcement",
              "type": "string"
            },
            {
              "id": "e78b0202-ec24-408f-820d-2797b79a034a",
              "name": "Topic Hint",
              "value": "New Digest feature — AI compiles team video updates into a 5-min daily overview. Drive early access sign-ups. CTA link: loopin.co/digest-early-access",
              "type": "string"
            },
            {
              "id": "f3d6d184-5035-4c87-84bc-8865820006f4",
              "name": "Tone Note",
              "value": "Speak to managers with overflowing video queues. Exciting, not corporate.",
              "type": "string"
            },
            {
              "id": "c510acd7-c187-46af-a2e0-3e98fa3c4285",
              "name": "submitted_at",
              "value": "={{ $now }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -2288,
        496
      ],
      "id": "79694273-4866-4304-a8f7-088f83542a3b",
      "name": "TB-01"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -2672,
        320
      ],
      "id": "47f2c130-9f21-4224-8c9b-40d055c3df71",
      "name": "When clicking ‘Execute workflow’"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "1f7a3cdb-2a7c-43fc-a492-98a08b1be8d8",
              "name": "Client",
              "value": "Loopin",
              "type": "string"
            },
            {
              "id": "a1e9f224-fe78-47e3-8fdb-fb52ee06507c",
              "name": "Platform",
              "value": "X",
              "type": "string"
            },
            {
              "id": "d274fdbb-2b2b-445b-a944-8a5d427213a3",
              "name": "Content Type",
              "value": "Thought leadership",
              "type": "string"
            },
            {
              "id": "e78b0202-ec24-408f-820d-2797b79a034a",
              "name": "Topic Hint",
              "value": "Hot take: companies adopt async tools without changing meeting habits — then wonder why it doesn't work.",
              "type": "string"
            },
            {
              "id": "f3d6d184-5035-4c87-84bc-8865820006f4",
              "name": "Tone Note",
              "value": "Founder voice. Direct, confident, slightly provocative. No CTA. Ends with a question or open statement.",
              "type": "string"
            },
            {
              "id": "c510acd7-c187-46af-a2e0-3e98fa3c4285",
              "name": "submitted_at",
              "value": "={{ $now }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -2464,
        496
      ],
      "id": "3200a107-0a6c-48d6-a856-cc8f1469aa80",
      "name": "TB-02"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "1f7a3cdb-2a7c-43fc-a492-98a08b1be8d8",
              "name": "Client",
              "value": "Loopin",
              "type": "string"
            },
            {
              "id": "a1e9f224-fe78-47e3-8fdb-fb52ee06507c",
              "name": "Platform",
              "value": "Instagram",
              "type": "string"
            },
            {
              "id": "d274fdbb-2b2b-445b-a944-8a5d427213a3",
              "name": "Content Type",
              "value": "Culture post",
              "type": "string"
            },
            {
              "id": "e78b0202-ec24-408f-820d-2797b79a034a",
              "name": "Topic Hint",
              "value": "Day in the life of Mia, product designer in Lisbon — fully async, no meetings. Mia's day: morning video update, 20 min reviewing async updates, 4 hrs deep work, design review video at 2pm, done at 5pm.",
              "type": "string"
            },
            {
              "id": "f3d6d184-5035-4c87-84bc-8865820006f4",
              "name": "Tone Note",
              "value": "Visual-first. Warm, real, not staged. Caption adds context — conversational tone. Ends with a question or invitation.",
              "type": "string"
            },
            {
              "id": "c510acd7-c187-46af-a2e0-3e98fa3c4285",
              "name": "submitted_at",
              "value": "={{ $now }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -2672,
        496
      ],
      "id": "7a2ae587-2318-43a5-a16b-e3bb5e57c2a9",
      "name": "TB-04"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        -2272,
        1520
      ],
      "id": "84fd2d69-1843-44d3-b2eb-d05aeecba128",
      "name": "Google Gemini Chat Model2",
      "retryOnFail": true,
      "credentials": {
        "googlePalmApi": {
          "id": "2qUzA3DAEFRc7DI1",
          "name": "Gemini FRAINK key"
        }
      }
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "C0B5JFMJK6E",
          "mode": "id"
        },
        "text": "=🎨 MARCUS: Marcus AI has proposed Post Content for *{{ $('Marcus AI').last().json.output.brief_id }}*\n\nReview limit 8 hrs\\nReview here 👇\n<{{$execution.resumeFormUrl}}|Open CONTENT Review Form>",
        "otherOptions": {}
      },
      "id": "7316fa43-4685-4cec-87e7-9d741e05a624",
      "name": "Content New Mssg",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.3,
      "position": [
        -1104,
        1968
      ],
      "webhookId": "8bb971c4-baa8-44b2-a6bf-2e2a800fb8ef",
      "credentials": {
        "slackApi": {
          "id": "V3dfJrNTD6Y86lSH",
          "name": "Slack 2"
        }
      }
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1xj7qATHD-qM-bzEFkThkW1wDo_c9SMVbsnsBwNA5RX0",
          "mode": "list",
          "cachedResultName": "Relay-Database",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xj7qATHD-qM-bzEFkThkW1wDo_c9SMVbsnsBwNA5RX0/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 1647509080,
          "mode": "list",
          "cachedResultName": "social-specs",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xj7qATHD-qM-bzEFkThkW1wDo_c9SMVbsnsBwNA5RX0/edit#gid=1647509080"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -2608,
        2144
      ],
      "id": "267c1f04-600f-437e-921a-213610d84753",
      "name": "Get Social Specs",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "CjB4pVPhUNjDvDTe",
          "name": "DS Ggl Sheet"
        }
      }
    },
    {
      "parameters": {
        "method": "=POST",
        "url": "=https://fal.run/fal-ai/recraft/v4/text-to-image",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "prompt",
              "value": "={{ $json.output.image_prompt }}"
            },
            {
              "name": "image_size",
              "value": "square_hd"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.3,
      "position": [
        -1824,
        2144
      ],
      "id": "f4eb6bbc-fe6b-4672-996a-de2dfd9721f0",
      "name": "Flux",
      "credentials": {
        "httpHeaderAuth": {
          "id": "cWPwwvuCILmAPHJI",
          "name": "fal.ai"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://n8n.airpg.ai/webhook/marcus-revise",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "brief_id",
              "value": "={{ $('Revise Instruct to Marcus').item.json.brief_id }}"
            },
            {
              "name": "revise_note",
              "value": "={{ $('Revise Instruct to Marcus').item.json.revise_note }} + {{ $('Revise Instruct to Marcus').item.json.ai_summary }} + {{ $('Revise Instruct to Marcus').item.json.ai_quality_flags }}"
            },
            {
              "name": "client",
              "value": "={{ $('Taylor Webhook').item.json.body.client }}"
            },
            {
              "name": "platform",
              "value": "={{ $('Taylor Webhook').item.json.body.platform }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        -80,
        2928
      ],
      "id": "bca5f058-b161-4567-af54-8973aa0a97b7",
      "name": "To Marcus2"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "b93a90b0-352e-4b65-9562-b40ebc535c16",
              "name": "revise_instruct",
              "value": "=Attention, your last post angles were declined. Here is your instuct: {{ $('Approve Form2').item.json['Revise Note'] }}",
              "type": "string"
            },
            {
              "id": "09ba8cea-e4dd-47f7-a01f-d24fcef6def7",
              "name": "brief_id",
              "value": "={{ $json.brief_id }}",
              "type": "string"
            },
            {
              "id": "ffa866bf-f731-4441-a5df-1f829e4d580d",
              "name": "revised_brief_id",
              "value": "={{ $json.brief_id.replace(/-(\\d+)$/, (match, p1) => '-' + String(Number(p1) + 1).padStart(p1.length, '0')) }}",
              "type": "string"
            }
          ]
        },
        "includeOtherFields": true,
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -480,
        2928
      ],
      "id": "e6aed70d-384e-43e8-8995-6f9b8254b737",
      "name": "Revise Instruct to Marcus"
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "marcus-revise",
        "responseMode": "lastNode",
        "responseData": "allEntries",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        -784,
        1888
      ],
      "id": "3badd310-3787-423d-b4ef-e58160a1efff",
      "name": "Taylor-Marcus Revise",
      "webhookId": "156fd96d-4751-462a-b50b-bd2a81cecee9"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "77ce21a0-6384-4330-9efd-e5b6dbabec8f",
              "name": "tone",
              "value": "={{ $json[ $('Marcus Webhook').item.json.body.platform.toLowerCase() + '_tone' ] }}",
              "type": "string"
            },
            {
              "id": "aeebdd32-4eac-4c91-95b7-a96bada2f2d5",
              "name": "hook_formulas",
              "value": "={{ $json[ $('Marcus Webhook').item.json.body.platform.toLowerCase() + '_hook_formulas' ] }}",
              "type": "string"
            },
            {
              "id": "266b6734-10b3-4379-a1a2-67e46fc52981",
              "name": "specs",
              "value": "={{ $json[ $('Marcus Webhook').item.json.body.platform.toLowerCase() + '_specs' ] }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -2384,
        2144
      ],
      "id": "98d062f9-9d8c-4a5c-8c9f-89ec374a5013",
      "name": "Edit Fields"
    },
    {
      "parameters": {
        "accountId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "options": {}
      },
      "type": "@blotato/n8n-nodes-blotato.blotato",
      "typeVersion": 2,
      "position": [
        -208,
        2704
      ],
      "id": "31a1d760-943e-4311-bc2c-05420f6e6d0c",
      "name": "BLOTATO",
      "disabled": true
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "claude-haiku-4-5-20251001",
          "mode": "list",
          "cachedResultName": "Claude Haiku 4.5"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "typeVersion": 1.3,
      "position": [
        -1904,
        3200
      ],
      "id": "88d6c567-d9bf-4e8f-b420-2718fc515888",
      "name": "Anthropic Chat Model",
      "credentials": {
        "anthropicApi": {
          "id": "6DASJKh1NQnhlE15",
          "name": "Anthropic account"
        }
      }
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1xj7qATHD-qM-bzEFkThkW1wDo_c9SMVbsnsBwNA5RX0",
          "mode": "list",
          "cachedResultName": "Relay-Database",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xj7qATHD-qM-bzEFkThkW1wDo_c9SMVbsnsBwNA5RX0/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 127845294,
          "mode": "list",
          "cachedResultName": "client-database",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xj7qATHD-qM-bzEFkThkW1wDo_c9SMVbsnsBwNA5RX0/edit#gid=127845294"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "client",
              "lookupValue": "={{ $('Taylor-Marcus Revise').isExecuted ? $('Taylor-Marcus Revise').item.json.body.client : $('Marcus AI').item.json.output.client }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -48,
        2240
      ],
      "id": "eff49b46-22fd-4d1a-8daa-6dd29f1ca2cd",
      "name": "DB Client",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "CjB4pVPhUNjDvDTe",
          "name": "DS Ggl Sheet"
        }
      }
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Get previous post content from Google Sheets by brief_id. ",
        "documentId": {
          "__rl": true,
          "value": "1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8",
          "mode": "list",
          "cachedResultName": "Ad_Pipeline_v2",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 780992481,
          "mode": "list",
          "cachedResultName": "Post Content",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit#gid=780992481"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "brief_id",
              "lookupValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('values0_Value', ``, 'string') }}"
            }
          ]
        },
        "options": {
          "dataLocationOnSheet": {
            "values": {
              "rangeDefinition": "detectAutomatically"
            }
          }
        }
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.7,
      "position": [
        -2064,
        2368
      ],
      "id": "4afd8fb6-a3d4-418d-8807-b37a3895add5",
      "name": "Read DB",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "CjB4pVPhUNjDvDTe",
          "name": "DS Ggl Sheet"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "=1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": 780992481,
          "mode": "list",
          "cachedResultName": "Post Content",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit#gid=780992481"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": 0,
            "brief_id": "={{ $('Marcus AI').last().json.output.brief_id }}",
            "content_status": "Revise",
            "marcus_revise_note": "={{ $('Approve Form1').item.json['Revise Note'] }}"
          },
          "matchingColumns": [
            "brief_id"
          ],
          "schema": [
            {
              "id": "brief_id",
              "displayName": "brief_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "created_at",
              "displayName": "created_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "approved_angle",
              "displayName": "approved_angle",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "client",
              "displayName": "client",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "platform",
              "displayName": "platform",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "content_type",
              "displayName": "content_type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "post_text",
              "displayName": "post_text",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "image_prompt",
              "displayName": "image_prompt",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "format",
              "displayName": "format",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "image_1",
              "displayName": "image_1",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "image_2",
              "displayName": "image_2",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "image_3",
              "displayName": "image_3",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "carousel_slide_count",
              "displayName": "carousel_slide_count",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "carousel_json",
              "displayName": "carousel_json",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "approve_note",
              "displayName": "approve_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "marcus_revise_note",
              "displayName": "marcus_revise_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "taylor_revise_note",
              "displayName": "taylor_revise_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "rejected_by_stage",
              "displayName": "rejected_by_stage",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "content_status",
              "displayName": "content_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "7f117a87-19e2-402a-99e6-222fafb5c9cb",
      "name": "DB - Log Revise Note",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -464,
        2240
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "CjB4pVPhUNjDvDTe",
          "name": "DS Ggl Sheet"
        }
      },
      "notes": "approved output → write approval to Strategy tab then pass to Marcus leg"
    },
    {
      "parameters": {
        "content": "## Slack Approval",
        "height": 768,
        "width": 256,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1184,
        1728
      ],
      "typeVersion": 1,
      "id": "778105a7-ace6-4552-a3c4-4fb2c15c20eb",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "## Slack Approval",
        "height": 736,
        "width": 272,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1088,
        864
      ],
      "typeVersion": 1,
      "id": "c44b128a-83cc-4311-81f0-563deebb2313",
      "name": "Sticky Note4"
    },
    {
      "parameters": {
        "content": "## Slack Approval",
        "height": 640,
        "width": 272,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1488,
        2720
      ],
      "typeVersion": 1,
      "id": "1745821a-1975-43f4-8129-8e2df20a6af3",
      "name": "Sticky Note5"
    },
    {
      "parameters": {
        "content": "## Taylor bypass - revision (new execution)",
        "height": 304,
        "width": 224,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -848,
        1728
      ],
      "typeVersion": 1,
      "id": "00cc35bc-e347-491e-be39-558c878c8d04",
      "name": "Sticky Note6"
    },
    {
      "parameters": {
        "content": "##  <-- HitL revision line <--",
        "height": 80,
        "width": 416,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1632,
        2336
      ],
      "typeVersion": 1,
      "id": "943582b7-17be-48cd-9587-77b5d853bc54",
      "name": "Sticky Note7"
    },
    {
      "parameters": {
        "content": "##  <-- HitL revision line <--",
        "height": 80,
        "width": 416,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1632,
        1488
      ],
      "typeVersion": 1,
      "id": "0c1a62e1-1837-4fc9-aa34-c3ac639d2374",
      "name": "Sticky Note8"
    },
    {
      "parameters": {
        "content": "# Demo",
        "height": 384,
        "width": 672,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2768,
        256
      ],
      "typeVersion": 1,
      "id": "830f41a1-6f55-4b31-b865-30c5683025a8",
      "name": "Sticky Note9"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "=1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": 780992481,
          "mode": "list",
          "cachedResultName": "Post Content",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1N3iOkwTFPuuba2AXIEj8FsIxyB447CW1bp0E7hJprv8/edit#gid=780992481"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_number": 0,
            "brief_id": "={{ $json.body.brief_id }}",
            "content_status": "Revise",
            "taylor_revise_note": "={{ $json.body.revise_note }}"
          },
          "matchingColumns": [
            "brief_id"
          ],
          "schema": [
            {
              "id": "brief_id",
              "displayName": "brief_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "created_at",
              "displayName": "created_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "approved_angle",
              "displayName": "approved_angle",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "client",
              "displayName": "client",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "platform",
              "displayName": "platform",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "content_type",
              "displayName": "content_type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "post_text",
              "displayName": "post_text",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "image_prompt",
              "displayName": "image_prompt",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "format",
              "displayName": "format",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "image_1",
              "displayName": "image_1",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "image_2",
              "displayName": "image_2",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "image_3",
              "displayName": "image_3",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "carousel_slide_count",
              "displayName": "carousel_slide_count",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "carousel_json",
              "displayName": "carousel_json",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "approve_note",
              "displayName": "approve_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "marcus_revise_note",
              "displayName": "marcus_revise_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "taylor_revise_note",
              "displayName": "taylor_revise_note",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "rejected_by_stage",
              "displayName": "rejected_by_stage",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "content_status",
              "displayName": "content_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "75e98276-8663-48e1-9970-0bd3db78d05e",
      "name": "DB - Taylor Revise",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -464,
        2080
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "CjB4pVPhUNjDvDTe",
          "name": "DS Ggl Sheet"
        }
      },
      "notes": "approved output → write approval to Strategy tab then pass to Marcus leg"
    },
    {
      "parameters": {
        "content": "",
        "height": 288,
        "width": 640,
        "color": "#4A4B11"
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        2064
      ],
      "typeVersion": 1,
      "id": "30cdeb2b-ca47-44a8-8bb9-f5db4a75e440",
      "name": "Sticky Note27"
    },
    {
      "parameters": {
        "content": "",
        "height": 272,
        "width": 1040,
        "color": "#4A4B11"
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -896,
        2912
      ],
      "typeVersion": 1,
      "id": "8b39dd52-e7a3-4ea3-a30b-27b6a6e3c65c",
      "name": "Sticky Note28"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "b93a90b0-352e-4b65-9562-b40ebc535c16",
              "name": "revise_instruct",
              "value": "=Attention, your last post angles were declined. Here is your instruct: {{ $('Approve Form1').item.json['Revise Note'] }}",
              "type": "string"
            },
            {
              "id": "09ba8cea-e4dd-47f7-a01f-d24fcef6def7",
              "name": "brief_id",
              "value": "={{ $('Marcus AI').last().json.body.brief_id }}",
              "type": "string"
            },
            {
              "id": "ffa866bf-f731-4441-a5df-1f829e4d580d",
              "name": "revised_brief_id",
              "value": "={{ $json.brief_id.replace(/-(\\d+)$/, (match, p1) => '-' + String(Number(p1) + 1).padStart(p1.length, '0')) }}",
              "type": "string"
            },
            {
              "id": "c0a3dd34-0ae3-4a6c-a9ae-89dc120a59ef",
              "name": "client",
              "value": "={{ $('Marcus AI').last().json.body.client}}",
              "type": "string"
            },
            {
              "id": "fc602232-41ba-45cb-a805-b10cdd72341d",
              "name": "platform",
              "value": "={{ $('Marcus AI').last().json.body.platform }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -256,
        2240
      ],
      "id": "b6ee37cb-f7a2-467e-866f-76c8ed1e6129",
      "name": "M-Instruct"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "b93a90b0-352e-4b65-9562-b40ebc535c16",
              "name": "revise_instruct",
              "value": "=Attention, your last post angles were declined. Here is your instruct: {{ $('Taylor-Marcus Revise').item.json.body.revise_note }}",
              "type": "string"
            },
            {
              "id": "09ba8cea-e4dd-47f7-a01f-d24fcef6def7",
              "name": "brief_id",
              "value": "={{ $('Taylor-Marcus Revise').item.json.body.brief_id }}",
              "type": "string"
            },
            {
              "id": "ffa866bf-f731-4441-a5df-1f829e4d580d",
              "name": "revised_brief_id",
              "value": "={{ $json.brief_id.replace(/-(\\d+)$/, (match, p1) => '-' + String(Number(p1) + 1).padStart(p1.length, '0')) }}",
              "type": "string"
            },
            {
              "id": "c0a3dd34-0ae3-4a6c-a9ae-89dc120a59ef",
              "name": "client",
              "value": "={{ $('Taylor-Marcus Revise').item.json.body.client }}",
              "type": "string"
            },
            {
              "id": "fc602232-41ba-45cb-a805-b10cdd72341d",
              "name": "platform",
              "value": "={{ $('Taylor-Marcus Revise').item.json.body.platform }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -256,
        2080
      ],
      "id": "8ae8a9bc-75cb-409f-bce3-4597ea4f9101",
      "name": "T-Instruct"
    },
    {
      "parameters": {
        "content": "# 🗺️ Workflow Overview - HitL 'Human in the Loop' Post Creation\n\n## **Content Agency Flow**  \n*Human-In-The-Loop Social Media Creation*\n\n-  **Slack as the Comms Hub** — All real-time status alerts, interactive review forms, and routing notifications are pushed directly to Slack to keep creative teams in sync.\n-  **Sheets as the Data Backbone** — Strategy angles, post drafts, image assets, and compliance scorecards are logged and indexed continuously across databases.\n-  **Brief ID as the Master Key** — Formulated at intake as `MMDDYY-Client-Platform-001` and incremented recursively (e.g., `-002`) on revisions. This identifier coordinates database writes, agent prompts, and Slack alerts.\n\n---\n\n## 🗺️ Flow Structure: 3 Human-AI Collaboration Gates\n\n### 🎯 Phase 1 — Sofia Strategy\n\n- **Intake Form Trigger** — Client, platform, content type, and initial topic seeds are captured. In Slack - use bookmark \"CREATE NEW BRIEF\" (pointed to the form trigger)\n- **Client Validation** — System checks the client profile in the Relay-Database. If missing, it alerts IT via Gmail and pauses the queue.\n- **Sofia AI Strategic Ideation** — Sofia researches trends and drafts 3 distinct conceptual angles.\n- **HitL Strategist Review** — Picks the winning angle, triggers a revision iteration, or cancels.\n\n### 🎨 Phase 2 — Marcus Post Content\n\n- **Internal Handoff** — Incoming approved strategical angles trigger Marcus via webhook.\n- **Marcus AI Execution** — Drafts channel-native copy and details visual directions optimized for the Flux/Recraft/v4 generator.\n- **Recraft model Asset Generation** — Renders the high-fidelity ad creative with text overlays.\n- **HitL Editor Gate** — Human-in-the-loop review approves, cancels, or routes revisions to Marcus.\n\n### 👑 Phase 3 — Taylor Approval\n\n- **Taylor AI Audit** — Automated auditor cross-checks post text and images against tone, visual standards, and banned words.\n- ** HitL Final Decision Sign-off** — Human executive approves for scheduled publication, cancels, or sends back to Marcus or Sofia with revision logs.\n\n## Live run video https://youtu.be/rJ5n9Nq9CSc",
        "height": 816,
        "width": 784,
        "color": "#FEFFA8"
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4512,
        848
      ],
      "typeVersion": 1,
      "id": "61b47572-3f73-4c49-99b3-8b3aa7573087",
      "name": "Sticky Note15"
    },
    {
      "parameters": {
        "content": "# ⚙️ Setup Guide\n\n##  1. Google Sheets Setup (Pre-configured)\n\n- No need to rebuild database schemas manually! Download our pre-configured templates using the public Drive link:  \n👉 [Google Drive Templates](https://drive.google.com/drive/folders/1uhw8HB5r3Q4UrkHv63PyxKpH5Fk7mSzq?usp=drive_link)\n- Import these into your Google Drive and authorize your **Google Sheets OAuth2 credentials** within all Sheet nodes.\n\n##  2. Slack Setup (Manual Deployment Note)\n\n- Slack requires explicit scopes and setup in the Slack Web UI to run this dashboard:\n  - Ensure your Slack App manifest has the `chat:write` scope active.\n  - Invite your app to your target social operations channel.\n  - Copy your **Slack Channel ID** (e.g., `C0B5JFMJK6E`) and paste it directly into the **Channel ID parameter field** inside all Slack nodes.\n  - Create \"CREATE NEW BRIEF\" bookmark in Slack channel - point to Sofia Brief Intake Form node.\n\n## 🔗 3. Webhook Canvas Isolation (Clean Architecture)\n\n- To keep the canvas clean and prevent an overlapping mess of connection lines, this layout uses **decoupled webhooks** to pass payloads:\n  - **Webhook URLs** — On import, n8n randomizes your webhook paths (Marcus Webhook & Taylor Webhook).\n  - **Update Nodes** — Copy these new paths from your webhook nodes and paste them into the **target URL parameters** of the matching outbound triggers (To Marcus and To Taylor).\n- **Note:** Since executions break into separate processes across webhooks, track state updates using your **central Sheet logs**!s/components/sticky-notes/)\n\n##  4. Update Other Creds\n### Update your LLM tool node Creds. Update your image gen in 'Flux' node (recraft used from fal.ai as a cost efficient model that CAN render perfect text overlays).\n",
        "height": 688,
        "width": 784,
        "color": "#FEFFA8"
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4512,
        1696
      ],
      "typeVersion": 1,
      "id": "5ec0ad13-e8d1-405d-940d-89d027d4c725",
      "name": "Sticky Note16"
    },
    {
      "parameters": {
        "content": "## 🔄 Wait Node: Parallel Form Resume Trick\n\n## Cross-Execution Token Binding\n\n- When n8n pauses an execution thread at a **Wait node** to generate a manual approval form, parallel branches can struggle to pass state keys downstream.\n- This workflow uses a neat architecture: the parallel Slack notification node carries the `$execution.resumeFormUrl` expression. Because this is broadcasted right as the execution reaches the wait state, teams can securely click the **interactive link in Slack** to submit approvals without losing workflow metadata or context flags.\n",
        "height": 224,
        "width": 352,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1088,
        640
      ],
      "typeVersion": 1,
      "id": "55f08712-fdec-4b84-9871-be5fd177ad30",
      "name": "Sticky Note17"
    },
    {
      "parameters": {
        "content": "## 🔁 Revision Logic: Taylor to Marcus Hook\n\n## Closed-Loop Production Corrections\n\n- If Taylor rejects a draft post in the final phase, she can trigger a revision directly back to Marcus instead of resetting the strategy phase with Sofia.\n- This handoff re-enters the active production environment via the **Taylor-Marcus Revise webhook**.\n- Marcus AI calls its custom retrieval tool to compare previous attempts, processes the revision comments, and outputs a revised post under an updated brief suffix (e.g., `...-002`).",
        "height": 272,
        "width": 560,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        3440
      ],
      "typeVersion": 1,
      "id": "58284c16-c60e-4a83-b8ee-12af1e440cb6",
      "name": "Sticky Note29"
    },
    {
      "parameters": {
        "content": "## * n8n May Community Challenge Winner * https://www.youtube.com/watch?v=WjafiTfvp0Q at 1:01:33 ",
        "width": 784,
        "color": "#3D3D3D"
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4496,
        624
      ],
      "typeVersion": 1,
      "id": "ef4d8786-3b88-4b78-9044-15fe040c44fa",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "## AI Strategy research and creation\n### DB write",
        "height": 464,
        "width": 1456,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2544,
        1136
      ],
      "typeVersion": 1,
      "id": "66433763-f86f-4e35-bd08-ca207eb614f3",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "content": "## AI content creation and media generation\n### DB write",
        "height": 528,
        "width": 1664,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2848,
        1968
      ],
      "typeVersion": 1,
      "id": "21175709-f70c-43f0-8232-2f0401aa07cc",
      "name": "Sticky Note30"
    },
    {
      "parameters": {
        "content": "## AI review and post approval\n### DB write",
        "height": 464,
        "width": 768,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2240,
        2896
      ],
      "typeVersion": 1,
      "id": "afa9b01e-374e-4584-8447-32dae9fe1fea",
      "name": "Sticky Note31"
    },
    {
      "parameters": {
        "content": "",
        "height": 112,
        "width": 1056,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -912,
        2704
      ],
      "typeVersion": 1,
      "id": "cf9226b8-0be4-4410-b584-25ec4acb791d",
      "name": "Sticky Note32"
    },
    {
      "parameters": {
        "content": "## Approved",
        "height": 112,
        "width": 320,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        1840
      ],
      "typeVersion": 1,
      "id": "6ede1204-8913-4120-9244-c914fe56178a",
      "name": "Sticky Note33"
    },
    {
      "parameters": {
        "content": "",
        "height": 112,
        "width": 624,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        1840
      ],
      "typeVersion": 1,
      "id": "49cc5985-bd12-4f33-a307-56dddf992c8a",
      "name": "Sticky Note34"
    },
    {
      "parameters": {
        "content": "",
        "height": 112,
        "width": 624,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        1088
      ],
      "typeVersion": 1,
      "id": "21382b80-bba9-4daf-9f40-d68e85de2a53",
      "name": "Sticky Note35"
    },
    {
      "parameters": {
        "content": "## Approved",
        "height": 112,
        "width": 320,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        1088
      ],
      "typeVersion": 1,
      "id": "a03b346f-8231-4dee-8976-0884a2ceba03",
      "name": "Sticky Note36"
    },
    {
      "parameters": {
        "content": "",
        "height": 96,
        "width": 624,
        "color": "#4A4B11"
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        1312
      ],
      "typeVersion": 1,
      "id": "92305716-0246-4ec0-b17d-59f0403a3171",
      "name": "Sticky Note37"
    },
    {
      "parameters": {
        "content": "# Human-In-The-Loop Content Agency Flow: Slack / Sheets\n\nThis n8n template automates **end-to-end social media content creation** with **three HitL collaborative phases**: strategy ideation, content generation, and approval. Employees receive Slack updates from AI for review/approval. Designed for agencies and creative teams, it integrates **Slack, Google Sheets, and AI tools** (Flux/Recraft) to streamline workflows while keeping humans in control of critical decisions.\n\n---\n## Good to Know\n- **Human-AI Collaboration**: Combines AI efficiency with human oversight for strategy, execution, and approval.\n- **Modular Design**: Easily replace AI tools (e.g., Flux/Recraft) or platforms (e.g., Slack, Google Sheets) with your preferred alternatives.\n- **Scalable**: Works for single clients or large-scale agency operations.\n\n---\n## How It Works\n- **Phase 1 (Strategy)**: Captures briefs, validates clients, and uses AI to generate 3 conceptual angles for review.\n- **Phase 2 (Content)**: Drafts platform-native copy, generates assets, and routes drafts for human approval.\n- **Phase 3 (Approval)**: Audits content against brand guidelines and finalizes for publication.\n\n**Key Features**:\n- **Closed-Loop Revisions**: If rejected, drafts are sent back to AI with human revision notes. \n- **AI Revisions**: Ai Agent nodes use web search and client input with revision notes to revise.\n- **Brief ID**: the DB is updated with new Brief IDs on any revision. Post content state visual and dynamic.\n\n---\n## 🛠️ How to Use\n1. Trigger: Bookmark in Slack channel for Create New Brief.\n2. Employees monitor Slack channel for the AI proposals. Receive alerts.\n3. **Slack/Sheets**: Update channel IDs and sheet templates with your own.\n\n---\n## Requirements\n- **Slack**: App with `chat:write` scope.\n- **Google Sheets**: OAuth2 credentials for database logging.\n- **AI Tools**: Flux/Recraft (or alternatives) for asset generation.\n\n---\n## Customizing This Workflow\n- **Use Cases**: Adapt for **marketing campaigns, brand compliance audits, or multi-platform content pipelines**.\n- **Extensions**: Add nodes for Video creation, carousel.",
        "height": 1136,
        "width": 1008
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -5712,
        576
      ],
      "typeVersion": 1,
      "id": "e5205926-940c-4328-b037-64115fe72862",
      "name": "Sticky Note20"
    }
  ],
  "pinData": {},
  "connections": {
    "Generate brief_id": {
      "main": [
        [
          {
            "node": "DB  - Log Brief",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Serper": {
      "ai_tool": [
        [
          {
            "node": "Sofia AI",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Brief Intake Form": {
      "main": [
        [
          {
            "node": "Parse — Brief Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse — Brief Fields": {
      "main": [
        [
          {
            "node": "DB - Lookup Client",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Sofia AI",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Sofia AI": {
      "main": [
        [
          {
            "node": "OBJECTS Sofia",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New Client?": {
      "main": [
        [
          {
            "node": "Generate brief_id",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Email to IT - New Client",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email to IT - New Client": {
      "main": [
        [
          {
            "node": "IT Mssg",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Approve Form": {
      "main": [
        [
          {
            "node": "Route Decision",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Post Angles": {
      "ai_tool": [
        [
          {
            "node": "Sofia AI",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "If Revision": {
      "main": [
        [
          {
            "node": "DB - Log Revised Posts",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "DB - Upsert New Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DB  - Log Brief": {
      "main": [
        [
          {
            "node": "Sofia AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DB - Lookup Client": {
      "main": [
        [
          {
            "node": "New Client?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DB - Log Approved": {
      "main": [
        [
          {
            "node": "Approved Mssg",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DB -  Log Cancel": {
      "main": [
        [
          {
            "node": "Cancelled Mssg",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route Decision": {
      "main": [
        [
          {
            "node": "DB - Log Approved",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "DB - Log Revise Instruct",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "DB -  Log Cancel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "parse": {
      "ai_outputParser": [
        [
          {
            "node": "Marcus AI",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Approve Form1": {
      "main": [
        [
          {
            "node": "Route Decision1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Revision1": {
      "main": [
        [
          {
            "node": "Content Revised Mssg",
            "type": "main",
            "index": 0
          },
          {
            "node": "Approve Form1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Content New Mssg",
            "type": "main",
            "index": 0
          },
          {
            "node": "Approve Form1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DB -  Log Cancel1": {
      "main": [
        [
          {
            "node": "Cancelled Mssg1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route Decision1": {
      "main": [
        [
          {
            "node": "DB -  Log Approval",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "DB - Log Revise Note",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "DB -  Log Cancel1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Marcus AI": {
      "main": [
        [
          {
            "node": "Flux",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cancelled Mssg": {
      "main": [
        []
      ]
    },
    "parse1": {
      "ai_outputParser": [
        [
          {
            "node": "Taylor AI",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Approve Form2": {
      "main": [
        [
          {
            "node": "Route Decision2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route Decision2": {
      "main": [
        [
          {
            "node": "👑 DB - Log Approval",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "👑 DB - Log Revise",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "👑 DB - Log Cancelled",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Marcus Webhook": {
      "main": [
        [
          {
            "node": "Get Social Specs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Taylor Webhook": {
      "main": [
        [
          {
            "node": "Taylor AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Taylor AI": {
      "main": [
        [
          {
            "node": "👑 Slack - Taylor REVIEW",
            "type": "main",
            "index": 0
          },
          {
            "node": "Approve Form2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Revise Instruct": {
      "main": [
        [
          {
            "node": "Sofia AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DB - Log Revised Posts": {
      "main": [
        [
          {
            "node": "Approve Form",
            "type": "main",
            "index": 0
          },
          {
            "node": "Post Angles REVISED",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DB - Log Revise Instruct": {
      "main": [
        [
          {
            "node": "Revise Instruct",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OBJECTS Sofia": {
      "main": [
        [
          {
            "node": "If Revision",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DB - Upsert New Posts": {
      "main": [
        [
          {
            "node": "Approve Form",
            "type": "main",
            "index": 0
          },
          {
            "node": "Post Angles new",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post Angles new": {
      "main": [
        []
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Marcus AI",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Tavily": {
      "ai_tool": [
        [
          {
            "node": "Marcus AI",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "DB - Log Content": {
      "main": [
        [
          {
            "node": "If Revision1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DB -  Log Approval": {
      "main": [
        [
          {
            "node": "Approved Mssg1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Client": {
      "ai_tool": [
        [
          {
            "node": "Taylor AI",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "Revise Instruct to Marcus",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "👑 Revise Mssg Sofia",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "👑 DB - Log Revise": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "👑 DB - Log Cancelled": {
      "main": [
        [
          {
            "node": "👑 Cancel Mssg",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "👑 DB - Log Approval": {
      "main": [
        [
          {
            "node": "👑 Approve Mssg",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "👑 Slack - Taylor REVIEW": {
      "main": [
        []
      ]
    },
    "Approved Mssg1": {
      "main": [
        [
          {
            "node": "To Taylor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Approved Mssg": {
      "main": [
        [
          {
            "node": "To Marcus",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "TB-01": {
      "main": [
        []
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "TB-02",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Sofia AI",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get Social Specs": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Flux": {
      "main": [
        [
          {
            "node": "DB - Log Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "👑 Revise Mssg Marcus": {
      "main": [
        [
          {
            "node": "To Marcus2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Revise Instruct to Marcus": {
      "main": [
        [
          {
            "node": "👑 Revise Mssg Marcus",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Taylor-Marcus Revise": {
      "main": [
        [
          {
            "node": "DB - Taylor Revise",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Marcus AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Taylor AI",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "DB Client": {
      "main": [
        [
          {
            "node": "Marcus AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read DB": {
      "ai_tool": [
        [
          {
            "node": "Marcus AI",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "DB - Log Revise Note": {
      "main": [
        [
          {
            "node": "M-Instruct",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DB - Taylor Revise": {
      "main": [
        [
          {
            "node": "T-Instruct",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "M-Instruct": {
      "main": [
        [
          {
            "node": "DB Client",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "T-Instruct": {
      "main": [
        [
          {
            "node": "DB Client",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "TB-02": {
      "main": [
        [
          {
            "node": "Parse — Brief Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate"
  },
  "versionId": "cb9fb906-6f63-4909-ae20-23aeb4644099",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "f65635fe42aeebebf44eaa521e38cac56bb6b5ccb60db8ca4a763a8fbba06ee8"
  },
  "nodeGroups": [],
  "id": "VuNcoavuKlwqu67H",
  "tags": []
}