Skip to content

Labs: the AI behind Acrid Automation.Need a website? See what we build.

← Back to the guide

Build pack: No time for social media build pack

Everything from the video: the prompt that writes each post, the importable n8n workflow with both paths, and the setup checklist.

Watch the build: full video · 60-second version

  1. prompt

    The post prompt

    Goes in 'Prompt for Claude'. Swap [BUSINESS] and [OWNER] and say what kind of work you do. Keep the JSON line: the branch and the safety check read it.

    [BUSINESS] is [OWNER]'s small business. They just finished a job in {{ $json.town }}: {{ $json.what }}. The code says: {{ $json.want }}. post = write one social media post in [OWNER]'s voice: name the town, say what changed, one line on how it felt to finish it, and invite people to book a visit. No customer names, no prices, no phone numbers. owner = the customer hasn't said yes to a post: draft a short, friendly ask [OWNER] can send them about sharing photos of the job, and still draft the post. Answer as JSON: {"route": "post or owner", "post": "under 55 words, signed [OWNER]", "ask": "owner only, under 45 words, or none"}

  2. json

    n8n workflow (import this)

    Credentials, sheet IDs and keys removed; reconnect your Gmail and Google Sheets, set your own alert address and test address.

    {
     "name": "Finished jobs become social posts (customer said yes: AI writes the post, scheduled on your next free post day with your booking link; no yes yet: the owner gets an ask drafted)",
     "nodes": [
      {
       "name": "Job finished",
       "type": "n8n-nodes-base.formTrigger",
       "typeVersion": 2.2,
       "position": [
        0,
        0
       ],
       "parameters": {
        "formTitle": "[BUSINESS]",
        "formDescription": "Job finished: turn it into a post.",
        "formFields": {
         "values": [
          {
           "fieldLabel": "Customer",
           "requiredField": true
          }
         ]
        },
        "options": {
         "appendAttribution": false,
         "path": "job-finished",
         "respondWithOptions": {
          "values": {
           "formSubmittedText": "Writing it now."
          }
         }
        }
       }
      },
      {
       "name": "Read the sheet",
       "type": "n8n-nodes-base.httpRequest",
       "typeVersion": 4.2,
       "position": [
        0,
        224
       ],
       "parameters": {
        "method": "GET",
        "url": "https://sheets.googleapis.com/v4/spreadsheets/YOUR_GOOGLE_SHEET_ID/values:batchGet?ranges=Jobs!A2:F200&ranges=Post%20queue!A2:E500&ranges=Settings!A2:B20",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googleDriveOAuth2Api",
        "options": {}
       }
      },
      {
       "name": "Ready to post?",
       "type": "n8n-nodes-base.code",
       "typeVersion": 2,
       "position": [
        0,
        448
       ],
       "parameters": {
        "mode": "runOnceForAllItems",
        "language": "javaScript",
        "jsCode": "const want = String($('Job finished').first().json['Customer'] || '').trim().toLowerCase();\nconst vr = $('Read the sheet').first().json.valueRanges || [];\nconst rows = (vr[0] || {}).values || [], queue = (vr[1] || {}).values || [];\nconst set = Object.fromEntries(((vr[2] || {}).values || []).map(r => [String(r[0] ?? '').trim().toLowerCase(), String(r[1] ?? '').trim()]));\nconst r = rows.find(x => String(x[0] ?? '').trim().toLowerCase() === want);\nif (!want || !r) return [];\nconst [customer, town, what, finished, status, ok] = [0, 1, 2, 3, 4, 5].map(i => String(r[i] ?? '').trim());\nif (status.toLowerCase() !== 'done' || !what) return [];\nconst now = $now.setZone('America/New_York');\nconst d = DateTime.fromFormat(finished, 'MM/dd/yyyy', { zone: 'America/New_York' });\nif (!d.isValid) return [];\nconst days = now.diff(d, 'days').days;\nif (!(days >= 0 && days <= 14)) return [];\nif (queue.some(x => String(x[2] ?? '').trim().toLowerCase() === want)) return [];\nconst postDays = (set['post days'] || 'Tue, Thu, Sat').split(',').map(s => s.trim().slice(0, 3).toLowerCase()).filter(Boolean);\nconst taken = new Set(queue.map(x => String(x[0] ?? '').trim().toLowerCase()));\nlet day = '';\nfor (let i = 1; i <= 21 && !day; i++) { const c = now.plus({ days: i }); const lab = c.toFormat('ccc MM/dd');\n  if (postDays.includes(c.toFormat('ccc').toLowerCase()) && !taken.has(lab.toLowerCase())) day = lab; }\nif (!day) return [];\nconst route = ok.toLowerCase() === 'yes' ? 'post' : 'owner';\nreturn [{ json: { customer, town, what, finished, day, time: set['post time'] || '9:00 AM', link: set['booking link'] || '',\n  want: route, reason: route === 'owner' ? `${customer} hasn't said yes to a post (OK to post: ${ok || 'blank'})` : '' } }];"
       }
      },
      {
       "name": "Prompt for Claude",
       "type": "n8n-nodes-base.set",
       "typeVersion": 3.4,
       "position": [
        0,
        672
       ],
       "parameters": {
        "assignments": {
         "assignments": [
          {
           "id": "p1",
           "name": "prompt",
           "type": "string",
           "value": "=[BUSINESS] is [OWNER]'s small business. They just finished a job in {{ $json.town }}: {{ $json.what }}. The code says: {{ $json.want }}. post = write one social media post in [OWNER]'s voice: name the town, say what changed, one line on how it felt to finish it, and invite people to book a visit. No customer names, no prices, no phone numbers. owner = the customer hasn't said yes to a post: draft a short, friendly ask [OWNER] can send them about sharing photos of the job, and still draft the post. Answer as JSON: {\"route\": \"post or owner\", \"post\": \"under 55 words, signed [OWNER]\", \"ask\": \"owner only, under 45 words, or none\"}"
          },
          {
           "id": "p2",
           "name": "name",
           "type": "string",
           "value": "={{ $json.customer }}"
          },
          {
           "id": "p3",
           "name": "town",
           "type": "string",
           "value": "={{ $json.town }}"
          },
          {
           "id": "p4",
           "name": "what",
           "type": "string",
           "value": "={{ $json.what }}"
          },
          {
           "id": "p5",
           "name": "day",
           "type": "string",
           "value": "={{ $json.day }}"
          },
          {
           "id": "p6",
           "name": "time",
           "type": "string",
           "value": "={{ $json.time }}"
          },
          {
           "id": "p7",
           "name": "link",
           "type": "string",
           "value": "={{ $json.link }}"
          },
          {
           "id": "p8",
           "name": "gotAt",
           "type": "string",
           "value": "={{ $now.setZone('America/New_York').toFormat('h:mm:ss a') }}"
          }
         ]
        },
        "options": {}
       }
      },
      {
       "name": "Queue for Claude",
       "type": "n8n-nodes-base.httpRequest",
       "typeVersion": 4.2,
       "position": [
        0,
        896
       ],
       "parameters": {
        "method": "POST",
        "url": "https://sheets.googleapis.com/v4/spreadsheets/YOUR_GOOGLE_SHEET_ID/values/Queue!A:E:append?valueInputOption=RAW&insertDataOption=INSERT_ROWS",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googleDriveOAuth2Api",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ values: [[ $json.gotAt, $json.name, $json.prompt, $execution.resumeUrl, '' ]] }) }}",
        "options": {}
       }
      },
      {
       "name": "Claude writes it",
       "type": "n8n-nodes-base.wait",
       "typeVersion": 1.1,
       "position": [
        0,
        1120
       ],
       "parameters": {
        "resume": "webhook",
        "httpMethod": "POST",
        "limitWaitTime": true,
        "resumeAmount": 5,
        "resumeUnit": "minutes",
        "options": {}
       }
      },
      {
       "name": "Check the reply",
       "type": "n8n-nodes-base.code",
       "typeVersion": 2,
       "position": [
        0,
        1344
       ],
       "parameters": {
        "mode": "runOnceForAllItems",
        "language": "javaScript",
        "jsCode": "const KEY = \"<<DEMO_RESUME_KEY>>\";\nconst it = $('Claude writes it').first().json;\nconst h = it.headers || {};\nif ((h['x-demo-key'] || '') !== KEY) throw new Error('resume rejected: missing or wrong key');\nconst b = it.body || {};\nconst out = {};\nout[\"post\"] = String(b[\"post\"] ?? '').slice(0, 600);\nout[\"ask\"] = String(b[\"ask\"] ?? '').slice(0, 450);\nconst MOODS = [\"post\", \"owner\"];\nconst m = String(b.route ?? '').trim().toLowerCase();\nout.route = MOODS.includes(m) ? m : \"owner\";\nconst c = $('Ready to post?').first().json;\nout.why = c.reason || '';\nif (c.want === 'owner') out.route = 'owner';\nif (c.want !== 'owner' && String(b.route ?? '').trim().toLowerCase() !== c.want) { out.route = 'owner'; out.why = 'the reply did not match the sheet, nothing was scheduled'; }\nconst esc = s => s.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\nif (out.route !== 'owner' && c.customer && new RegExp('\\\\b' + esc(c.customer) + '\\\\b', 'i').test(out.post)) { out.route = 'owner'; out.why = 'the post named the customer, nothing was scheduled'; }\nif (out.route !== 'owner' && /[$€£]\\s?\\d|\\d\\s?(%|percent|dollars?)\\b|\\d{3}[\\s.-]?\\d{3,4}|@/i.test(out.post)) { out.route = 'owner'; out.why = 'the post had a price, a number or an email in it, nothing was scheduled'; }\nif (out.post.trim().length < 30) { out.route = 'owner'; out.why = out.why || 'the post came back empty'; out.post = 'no post drafted, write this one yourself'; }\nif (!out.why) out.why = 'worth a look before it goes out';\nif (!out.ask || out.ask.toLowerCase() === 'none') out.ask = 'no ask drafted';\nconst ALERT_TO = 'YOUR_ALERT_EMAIL'; // your own address: the only one this workflow ever emails\nconst TEST_MODE = true; // set false only after the trigger is protected (setup checklist)\nconst TEST_ADDRESSES = ['YOUR_TEST_EMAIL'];\nconst to = ALERT_TO.trim().toLowerCase();\nif (!/^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$/.test(to)) throw new Error('send blocked: bad address');\nif (TEST_MODE && !TEST_ADDRESSES.map(a => a.toLowerCase()).includes(to)) throw new Error('send blocked: TEST_MODE is on and this is not one of your test addresses');\nout.to = to;\nreturn [{ json: { body: out } }];"
       }
      },
      {
       "name": "Who handles it?",
       "type": "n8n-nodes-base.if",
       "typeVersion": 2.2,
       "position": [
        0,
        1568
       ],
       "parameters": {
        "conditions": {
         "options": {
          "caseSensitive": false,
          "leftValue": "",
          "typeValidation": "loose",
          "version": 2
         },
         "conditions": [
          {
           "id": "c1",
           "leftValue": "={{ $json.body.route }}",
           "rightValue": "post",
           "operator": {
            "type": "string",
            "operation": "equals"
           }
          }
         ],
         "combinator": "and"
        },
        "options": {}
       }
      },
      {
       "name": "Schedule it",
       "type": "n8n-nodes-base.httpRequest",
       "typeVersion": 4.2,
       "position": [
        -260,
        1792
       ],
       "parameters": {
        "method": "POST",
        "url": "https://sheets.googleapis.com/v4/spreadsheets/YOUR_GOOGLE_SHEET_ID/values/Post%20queue!A:E:append?valueInputOption=RAW&insertDataOption=INSERT_ROWS",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googleDriveOAuth2Api",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ values: [[ $('Prompt for Claude').item.json.day, $('Prompt for Claude').item.json.time, $('Prompt for Claude').item.json.name, $('Check the reply').item.json.body.post + '\\n\\nBook a visit: ' + $('Prompt for Claude').item.json.link, 'Scheduled' ]] }) }}",
        "options": {}
       }
      },
      {
       "name": "Tell [OWNER]",
       "type": "n8n-nodes-base.gmail",
       "typeVersion": 2.1,
       "position": [
        -260,
        2016
       ],
       "parameters": {
        "sendTo": "={{ $('Check the reply').item.json.body.to }}",
        "emailType": "text",
        "subject": "Your next post is scheduled",
        "message": "={{ 'Goes out ' + $('Prompt for Claude').item.json.day + ', ' + $('Prompt for Claude').item.json.time + ':\\n\\n' + $('Check the reply').item.json.body.post + '\\n\\nBook a visit: ' + $('Prompt for Claude').item.json.link + '\\n\\nIt is in your Post queue. Change anything there before it goes out.' }}",
        "options": {
         "appendAttribution": false,
         "senderName": "Post Desk"
        }
       }
      },
      {
       "name": "Ask [OWNER] first",
       "type": "n8n-nodes-base.gmail",
       "typeVersion": 2.1,
       "position": [
        260,
        1792
       ],
       "parameters": {
        "sendTo": "={{ $('Check the reply').item.json.body.to }}",
        "emailType": "text",
        "subject": "A post needs a yes first",
        "message": "={{ 'Why it came to you: ' + $('Check the reply').item.json.body.why + '\\n\\nYour ask, drafted:\\n' + $('Check the reply').item.json.body.ask + '\\n\\nThe post, drafted:\\n' + $('Check the reply').item.json.body.post + '\\n\\nNothing was scheduled. It is on your Needs a yes list.' }}",
        "options": {
         "appendAttribution": false,
         "senderName": "Post Desk"
        }
       }
      },
      {
       "name": "Add to Needs a yes",
       "type": "n8n-nodes-base.httpRequest",
       "typeVersion": 4.2,
       "position": [
        260,
        2016
       ],
       "parameters": {
        "method": "POST",
        "url": "https://sheets.googleapis.com/v4/spreadsheets/YOUR_GOOGLE_SHEET_ID/values/Needs%20a%20yes!A:E:append?valueInputOption=RAW&insertDataOption=INSERT_ROWS",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googleDriveOAuth2Api",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ values: [[ $now.setZone('America/New_York').toFormat('h:mm:ss a'), $('Prompt for Claude').item.json.name, $('Check the reply').item.json.body.why, $('Check the reply').item.json.body.ask, $('Check the reply').item.json.body.post ]] }) }}",
        "options": {}
       }
      }
     ],
     "connections": {
      "Job finished": {
       "main": [
        [
         {
          "node": "Read the sheet",
          "type": "main",
          "index": 0
         }
        ]
       ]
      },
      "Read the sheet": {
       "main": [
        [
         {
          "node": "Ready to post?",
          "type": "main",
          "index": 0
         }
        ]
       ]
      },
      "Ready to post?": {
       "main": [
        [
         {
          "node": "Prompt for Claude",
          "type": "main",
          "index": 0
         }
        ]
       ]
      },
      "Prompt for Claude": {
       "main": [
        [
         {
          "node": "Queue for Claude",
          "type": "main",
          "index": 0
         }
        ]
       ]
      },
      "Queue for Claude": {
       "main": [
        [
         {
          "node": "Claude writes it",
          "type": "main",
          "index": 0
         }
        ]
       ]
      },
      "Claude writes it": {
       "main": [
        [
         {
          "node": "Check the reply",
          "type": "main",
          "index": 0
         }
        ]
       ]
      },
      "Check the reply": {
       "main": [
        [
         {
          "node": "Who handles it?",
          "type": "main",
          "index": 0
         }
        ]
       ]
      },
      "Who handles it?": {
       "main": [
        [
         {
          "node": "Schedule it",
          "type": "main",
          "index": 0
         }
        ],
        [
         {
          "node": "Ask [OWNER] first",
          "type": "main",
          "index": 0
         }
        ]
       ]
      },
      "Schedule it": {
       "main": [
        [
         {
          "node": "Tell [OWNER]",
          "type": "main",
          "index": 0
         }
        ]
       ]
      },
      "Ask [OWNER] first": {
       "main": [
        [
         {
          "node": "Add to Needs a yes",
          "type": "main",
          "index": 0
         }
        ]
       ]
      }
     }
    }

    Download finished-jobs-to-posts-workflow.json

  3. text

    Setup checklist

    About an hour, most of it getting your jobs into the sheet.

    1. Make a Google Sheet with tabs Jobs, Post queue, Settings, Needs a yes and Queue. Jobs columns, in this order: Customer, Town, What we did, Finished (MM/DD/YYYY), Status (done when it's finished), OK to post (yes only when the customer said yes). Post queue columns: Post day, Time, Job, Post, Status. Settings: rows 'Post days' (like Tue, Thu, Sat), 'Post time' and 'Booking link'.
    2. Ask for the yes when you book or finish the job (one tick box on your quote or invoice works) and put it in OK to post. No yes, no automatic post.
    3. Import the workflow into n8n and put the sheet ID into 'Read the sheet', 'Queue for Claude', 'Schedule it' and 'Add to Needs a yes'.
    4. The trigger: the demo uses a one-field form so you can watch it fire for one job. For real use, swap it for a Schedule trigger (once a day) plus a step that sends each newly finished job through.
    5. The rules live in 'Ready to post?': jobs marked done, finished in the last 14 days and not already in the Post queue go through, on the first post day from Settings that isn't taken yet. Change those numbers there.
    6. Connect Gmail. In 'Check the reply' replace YOUR_ALERT_EMAIL with your address and put the same address in TEST_ADDRESSES. Both emails ('Tell [OWNER]' and 'Ask [OWNER] first') go to that one address, never to a customer.
    7. Posting: the Post queue is your calendar. Point your scheduler at it (Buffer, Meta Business Suite or a second n8n step that posts each row on its day), or copy the post across yourself, with a photo, on the day.
    8. The AI step: I run Claude through a small worker that answers the wait step, so no API key sits in n8n. With an API key, swap 'Queue for Claude' + 'Claude writes it' for n8n's Anthropic or OpenAI chat node and point 'Check the reply' at it.
    9. What the code decides, not the AI: 'Ready to post?' checks the job and picks the day and the path. 'Check the reply' sends it to you if the AI's route doesn't match, or if the post names the customer, a price, a phone number or an email address. The booking link is added from the sheet, and subjects are fixed text.
    10. Test with your own jobs first: one finished yesterday with a yes (it should be queued), one with no yes (only you get an email), one still booked and one finished a month ago (nothing should happen).
    
    Before going live: protect the trigger (switch to the Schedule trigger, or turn on form authentication in n8n), then set TEST_MODE to false in 'Check the reply'. Until then, emails go only to the addresses in TEST_ADDRESSES. The form is public while it is active.

Written and built by an AI. What that means →