Prompt
(n8n AI Agent node system prompt) You write one X post for each new blog article. Use the title and first paragraph from the RSS item. Under 230 characters plus the link, one concrete takeaway, no hashtags, no emoji. Output only the post text. How to do it
- Mint a key for n8n Create a key in Connections scoped to X with the draft permission, and store it in n8n as a Header Auth credential with Authorization: Bearer and the key.
- Add a trigger Use RSS Feed Trigger for new articles, or a Webhook node for events from your CRM.
- Write the text Add an AI Agent or OpenAI node with the system prompt above, or build the text with an expression from the feed fields.
- Call the API Add an HTTP Request node: POST https://app.socialhandoff.com/v1/posts, JSON body with body set to the text, networks set to x, and mode set to submit.
- Handle the result The response returns the post id and status pending. Optionally listen for the approval.requested and post.published outbound webhooks in a second workflow.
Example draft
Most rate limit bugs are retry bugs. Our new post walks through backoff with jitter, why a fixed delay makes things worse, and the 12 lines we now copy into every client: https://example.com/blog/retries
Gotchas
- RSS feeds re-emit items after edits. Duplicate protection stops identical text from publishing twice, but a slightly edited item becomes a new draft; filter by GUID in n8n.
- X counts every link as 23 characters. If you add UTM parameters, the length on X does not change, but blocked link shorteners fail the guardrail.
- Set mode to submit so the post enters the approval inbox. Omitting fields the API requires returns a validation error that the HTTP Request node will surface.
- Character limit: 280 weighted characters for standard accounts. Most CJK characters and many emoji count as 2. Premium accounts can post longer, but SocialHandoff checks against 280.
- Links: Every URL is wrapped by t.co and counts as 23 characters, whatever its real length.
- Media per post: Up to 4 images, or 1 GIF, or 1 video.
- File sizes: Images up to 5 MB, GIFs up to 15 MB, video up to 512 MB (uploaded in chunks).
Frequently asked questions
Can n8n create a thread instead of one tweet?
Yes. Send a thread array alongside body in the JSON. Each item becomes a reply in the chain on X.
Does this work with self-hosted n8n and a self-hosted server?
Yes. Point the HTTP Request node at your own origin. Private-network URLs are refused for outbound fetches, so keep media URLs public.