{ "name": "Schedule: create a Social Poster draft per weekday, optionally scheduled", "nodes": [ { "id": "4404ce6d-c45a-5b51-b3ba-8e3cf535aa8d", "name": "Overview", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ -300, -40 ], "parameters": { "content": "### How it works\nThe schedule runs every day at the set time (Europe/Berlin). “Choose today's caption” takes the caption for today's weekday from the seven fields in “Settings”. If today has no caption, the run ends without a post. Otherwise “Create the draft” saves it as a draft in Social Poster.\n\n### Draft or scheduled\nThe default is `mode` = `draft`: the workflow only creates a draft and schedules or publishes nothing. The link to view it is in the output of “Create the draft” under `draft.app_draft_url`. To schedule posts, set `mode` to `schedule`. “Schedule the draft” then schedules it `minutesFromNow` minutes later (at least 5) and confirms it. If your team requires approval, it waits under “Waiting for you”. There is no immediate publishing.\n\n### Setup\nThis template uses the unverified community node `n8n-nodes-social-poster` (tested with version 0.1.1). It runs on self-hosted n8n only, not on n8n Cloud. Install it under Settings → Community Nodes → Install. Guide: https://docs.n8n.io/integrations/community-nodes/installation/\nCreate “Social Poster API” credentials. You get the key in Social Poster under the account menu → AI access → API key for n8n. The base URL is `https://app.social-poster.io` without `/mcp`.\nIn “Settings”, enter your account reference (`acc_…`), an optional link and image URL, and the captions for Monday to Sunday. Set the time on the schedule node, the default is 9:00. Select the credentials on both Social Poster nodes and run it once by hand.\n\n### Customization\nLeave a day empty if nothing should go out. For a longer rotation, read the captions from a spreadsheet.", "height": 820, "width": 660, "color": 1 } }, { "id": "eb8915da-1ff2-522e-9d0c-af6e82c3c3a0", "name": "Schedule", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ 440, 80 ], "parameters": { "content": "## Daily at a set time\nThe default is 9:00 in the Europe/Berlin time zone.", "height": 260, "width": 240, "color": 7 } }, { "id": "2c50ee52-7b2c-5715-9159-0cf15b00a61b", "name": "Weekday captions", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ 720, 80 ], "parameters": { "content": "## Captions per day\nAccount reference, `mode` (default `draft`), `minutesFromNow` and the seven daily captions. An empty day is skipped.", "height": 260, "width": 520, "color": 7 } }, { "id": "e4a28ac1-9ddc-5649-8ed9-af5dde62bfc5", "name": "Draft or scheduled", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ 1280, 80 ], "parameters": { "content": "## Draft, optionally scheduled\nA draft is created only when today has a caption. With `mode` = `schedule`, “Schedule the draft” schedules it and confirms publishing.", "height": 260, "width": 1100, "color": 7 } }, { "id": "e0b73918-255c-5853-a19e-3400258ad39e", "name": "Note about repeats", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ 1580, 620 ], "parameters": { "content": "Every run uses the stored caption for that day again. Change or clear it if it should not come back.", "height": 150, "width": 520, "color": 3 } }, { "id": "f79a14b9-4447-417a-ad93-b15a23afaa58", "name": "Daily at 9:00", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2, "position": [ 520, 400 ], "parameters": { "rule": { "interval": [ { "field": "days", "daysInterval": 1, "triggerAtHour": 9, "triggerAtMinute": 0 } ] } } }, { "id": "fca02958-5402-4ac0-b3a9-b822fd16d1f2", "name": "Settings", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 800, 400 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "58573aaa-027b-4583-98c1-e290399d91f0", "name": "accountRef", "type": "string", "value": "acc_YOUR_ACCOUNT_REF" }, { "id": "d2fe7a9d-7bcb-5d65-b4ad-d7166c9127f5", "name": "mode", "type": "string", "value": "draft" }, { "id": "f988813f-51be-4dc5-8788-373db1d65950", "name": "minutesFromNow", "type": "number", "value": 15 }, { "id": "c834300c-add0-439e-82cb-8999a4ae0ef3", "name": "link", "type": "string", "value": "https://example.com" }, { "id": "2aa66c46-9bb6-44a4-864f-94c0e984aa50", "name": "mediaUrls", "type": "string", "value": "" }, { "id": "12ae7423-683c-41e0-8c57-199310a3fe06", "name": "title", "type": "string", "value": "" }, { "id": "18db4ab2-debb-41e5-9f0a-3c457d1e27d6", "name": "captionMonday", "type": "string", "value": "A good start to the week. Take a look at our current offers today." }, { "id": "273b3b25-31f2-4ed0-bea7-0e64a5194810", "name": "captionTuesday", "type": "string", "value": "" }, { "id": "e037e978-06a3-4917-b9db-e43c7741bc9f", "name": "captionWednesday", "type": "string", "value": "Midweek reminder: visit us or order online." }, { "id": "05b23752-0afa-4df3-a2dd-dc22b60be2ac", "name": "captionThursday", "type": "string", "value": "" }, { "id": "95312c61-b78b-49db-8010-a1f65204e4e3", "name": "captionFriday", "type": "string", "value": "For the weekend we have put together some fresh ideas for you." }, { "id": "4d8b7d52-fc38-451e-a2c3-5f02d8433bed", "name": "captionSaturday", "type": "string", "value": "" }, { "id": "809e2ecf-72bd-43f8-9a5b-00cef8561381", "name": "captionSunday", "type": "string", "value": "" } ] } } }, { "id": "f77d4985-f6ff-4521-9f79-6b48ac34bfa1", "name": "Choose today's caption", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 1080, 400 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "b799dba3-992f-47c5-82ec-c59e82515af4", "name": "accountRef", "type": "string", "value": "={{ $json.accountRef }}" }, { "id": "a3425dda-d94e-596d-83ab-00c8bb9e3451", "name": "mode", "type": "string", "value": "={{ $json.mode }}" }, { "id": "a2f608c6-d720-4c4f-a91f-f3d92b76bd07", "name": "minutesFromNow", "type": "number", "value": "={{ $json.minutesFromNow }}" }, { "id": "10720c1e-253f-4b18-aa88-37eea0e400dd", "name": "link", "type": "string", "value": "={{ $json.link }}" }, { "id": "45993f6f-1220-414a-88ff-042f3b31fdfd", "name": "mediaUrls", "type": "string", "value": "={{ $json.mediaUrls }}" }, { "id": "249cc03f-932e-47fa-bd41-712d3744423e", "name": "title", "type": "string", "value": "={{ $json.title }}" }, { "id": "b8f03b7e-a0bf-4ae6-83f2-1e14ad878a2a", "name": "weekday", "type": "number", "value": "={{ $now.setZone('Europe/Berlin').weekday }}" }, { "id": "d4c425fb-90d0-4178-a316-745752c16db3", "name": "caption", "type": "string", "value": "={{ ({1:$json.captionMonday,2:$json.captionTuesday,3:$json.captionWednesday,4:$json.captionThursday,5:$json.captionFriday,6:$json.captionSaturday,7:$json.captionSunday})[$now.setZone('Europe/Berlin').weekday] || '' }}" } ] } } }, { "id": "694108bf-1685-42c2-8329-75304e1ae38a", "name": "Caption present?", "type": "n8n-nodes-base.if", "typeVersion": 2.2, "position": [ 1360, 400 ], "parameters": { "options": {}, "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": false, "typeValidation": "loose" }, "combinator": "and", "conditions": [ { "id": "88fe3525-e8a3-441c-bc6f-1f7003ce8edb", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true }, "leftValue": "={{ $json.caption }}", "rightValue": "" } ] } } }, { "id": "613d095a-798e-51f9-abe7-4007a038da2f", "name": "Create the draft", "type": "n8n-nodes-social-poster.socialPoster", "typeVersion": 1, "position": [ 1640, 300 ], "parameters": { "resource": "draft", "operation": "create", "workspace": "", "account": "={{ $json.accountRef }}", "caption": "={{ $json.caption }}", "additionalFields": { "link": "={{ $json.link }}", "mediaUrls": "={{ $json.mediaUrls }}", "title": "={{ $json.title }}" } }, "credentials": { "socialPosterApi": { "id": "YOUR_SOCIAL_POSTER_CREDENTIAL", "name": "Social Poster API" } } }, { "id": "e300ea83-f780-5009-8f8d-76cdf6c5728c", "name": "Should it be scheduled?", "type": "n8n-nodes-base.if", "typeVersion": 2.2, "position": [ 1920, 300 ], "parameters": { "options": {}, "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": false, "typeValidation": "loose" }, "combinator": "and", "conditions": [ { "id": "46f5df42-2909-5563-94a5-244f00489309", "operator": { "type": "string", "operation": "equals" }, "leftValue": "={{ String($(\"Choose today's caption\").item.json.mode || \"\").trim().toLowerCase() }}", "rightValue": "schedule" } ] } } }, { "id": "dbc853dd-63d0-5e84-913c-f42f6dfd34cd", "name": "Schedule the draft", "type": "n8n-nodes-social-poster.socialPoster", "typeVersion": 1, "position": [ 2200, 200 ], "parameters": { "resource": "post", "operation": "scheduleDraft", "workspace": "", "draftRef": "={{ $('Create the draft').item.json.draft.draft_ref }}", "scheduleMode": "minutes", "minutesFromNow": "={{ $(\"Choose today's caption\").item.json.minutesFromNow }}", "xContentReviewed": false }, "credentials": { "socialPosterApi": { "id": "YOUR_SOCIAL_POSTER_CREDENTIAL", "name": "Social Poster API" } } } ], "pinData": {}, "connections": { "Daily at 9:00": { "main": [ [ { "node": "Settings", "type": "main", "index": 0 } ] ] }, "Settings": { "main": [ [ { "node": "Choose today's caption", "type": "main", "index": 0 } ] ] }, "Choose today's caption": { "main": [ [ { "node": "Caption present?", "type": "main", "index": 0 } ] ] }, "Caption present?": { "main": [ [ { "node": "Create the draft", "type": "main", "index": 0 } ] ] }, "Create the draft": { "main": [ [ { "node": "Should it be scheduled?", "type": "main", "index": 0 } ] ] }, "Should it be scheduled?": { "main": [ [ { "node": "Schedule the draft", "type": "main", "index": 0 } ], [] ] } }, "active": false, "settings": { "executionOrder": "v1", "availableInMCP": false, "timezone": "Europe/Berlin" }, "meta": { "templateCredsSetupCompleted": false }, "tags": [] }