# Post to Threads from n8n with an AI agent

Source: https://postgale.com/guides/n8n/threads

Yes, an n8n workflow can post to Threads through Postgale. Attach an MCP Client Tool node pointed at https://postgale.com/mcp to an n8n AI Agent node (or call the REST API from an HTTP Request node) with a Postgale API key, connect your Threads account in Postgale once, and the agent can text, image, video and carousel posts, reply chains and replies. A person can be required to approve every post, reply and message before it goes out.

## Can n8n post to Threads?

Postgale is the secure layer for AI agents on social media. MCP (Model Context Protocol) is the open standard that lets AI assistants such as Claude and Cursor use outside tools. An MCP server is what they connect to. n8n does not reach Threads on its own; with Postgale connected it gets tools for the Threads accounts you connected and nothing else.

| Task | What Postgale does |
| --- | --- |
| Publish | Text, image, video and carousels of 2–20 items; topic tag, reply control (who may reply), link attachment on text posts, alt text. |
| Threads | A list of thread items becomes a reply chain under the first post, published in order. |
| Replies | List replies and the conversation, reply, hide, and post a first comment. |
| Delete | Delete a published post. |
| Insights | Views, likes, replies, reposts, quotes and shares per post; account totals and follower demographics. |

## What do you need?

- A Threads account; the owner signs in once with Threads.
- A Postgale workspace, and a sign-in or an API key for the agent.
- For image, video or carousel posts: media on a public HTTPS URL.
- n8n, set up as below (Workflows with the HTTP Request or MCP Client Tool node).

## Step 1: connect your Threads account

1. Create a Postgale workspace and open Dashboard → Accounts.
2. Choose Connect Threads and sign in with the account you own, on the platform’s own page. Postgale stores the tokens encrypted and refreshes them.

## Step 2: connect n8n to Postgale

| Use | Node | When |
| --- | --- | --- |
| Fixed steps | HTTP Request | Your workflow knows what to post (a new blog post, a product update, a form submission). Call `POST /api/v1/posts` with the content and the account ids. |
| An agent decides | MCP Client Tool attached to an AI Agent node | The model reads the input (an inbox, a brief, a trigger) and chooses among Postgale’s tools: list accounts, upload media, create or schedule posts, read and reply to comments and messages. |

## How do I set up the MCP Client Tool node?

1. In Postgale, open Dashboard → API keys, create a key and copy it (it starts with `sk_` and is shown once). Connect the social accounts the agent may use under Dashboard → Accounts.
2. Add an AI Agent node with your model, and attach an MCP Client Tool node to it.
3. In the MCP Client Tool node set the endpoint to `https://postgale.com/mcp`, the transport to HTTP streamable, and authentication to a Bearer or Header Auth credential carrying `Authorization: Bearer sk_…`.
4. Leave the tool list on “all” to start, or select only the read-only tools until you trust the workflow.
5. Give the agent a system prompt that states the account ids it may use and whether it must save drafts or may schedule.

> Ask your agent: “You manage the Northline accounts in Postgale (ids in the context). For each new blog post in the input, draft one Instagram caption with the cover image and one Threads post, save them as drafts, and reply with the Postgale post ids.”

## How do I set up the HTTP Request node?

1. In Postgale, open Dashboard → API keys, create a key and copy it (it starts with `sk_` and is shown once). Connect the social accounts the agent may use under Dashboard → Accounts.
2. In n8n create a credential of type Header Auth with name `Authorization` and value `Bearer sk_…` (your key).
3. Add an HTTP Request node: method POST, URL `https://postgale.com/api/v1/posts`, authentication Header Auth with that credential, body type JSON:

HTTP Request body (JSON):
```json
{
  "content": "{{ $json.caption }}",
  "scheduledFor": "{{ $json.publishAt }}",
  "platforms": [
    {
      "accountId": "acc_instagram",
      "platformSpecificData": {
        "mediaUrl": "{{ $json.imageUrl }}"
      }
    },
    {
      "accountId": "acc_threads"
    }
  ]
}
```

1. Get the account ids once with a GET to `https://postgale.com/api/v1/accounts` using the same credential.
2. Optional: send an `x-request-id` header built from your trigger id, so a re-run of the workflow returns the same post instead of a duplicate.
3. To know when the post is live, add a Webhook node and register its URL in Postgale (Dashboard → Webhooks); Postgale sends post.published or post.failed, signed with HMAC-SHA256.

## What can I ask the agent to do on Threads?

Check the connection first: “Which Threads accounts are connected in Postgale?” Then, in plain language:

> Ask your agent: “Turn this changelog into a three-post Threads reply chain. Drafts only.”

> Ask your agent: “Post a short Threads update with this screenshot at 4pm today.”

> Ask your agent: “List the replies under yesterday’s Threads post and draft answers to the questions.”

POST /api/v1/posts (Threads):
```json
{
  "content": "The fall drop is live. Shipping Thursday.",
  "scheduledFor": "2026-10-22T13:00:00Z",
  "platforms": [
    {
      "accountId": "acc_threads",
      "platformSpecificData": {
        "topicTag": "fall",
        "replyControl": "accounts_you_follow",
        "threadItems": [
          {
            "content": "The fall drop is live. Shipping Thursday."
          },
          {
            "content": "Three fabrics, one cut."
          },
          {
            "content": "Sizes XS–XXL, restock in November."
          }
        ]
      }
    }
  ]
}
```

## Which Threads rules does Postgale enforce?

- Text up to 500 characters per post. Longer content goes in a reply chain, not a cut-off post.
- Carousels take 2 to 20 items. Media comes from a public HTTPS URL and is processed by Meta before Postgale publishes.
- Threads limits posts and replies per 24 hours (250 posts and 1,000 replies by default). Postgale reads the live quota before publishing.
- Tokens last 60 days and are refreshed by Postgale before they lapse.

## How do I keep a person in the loop?

- Approval: tick “Hold posts from this app for approval” when you sign in, or in the Postgale dashboard require approval for the API key the agent uses (or for the whole workspace, or one account). Posts then wait as pending approval; comment replies and moderation, direct messages, WhatsApp sends and edits to live posts wait in the same queue. A person approves, edits or rejects each one in Dashboard → Approvals; the agent’s own key or sign-in cannot approve.
- Tool annotations: every Postgale tool declares whether it only reads, writes, or publishes live, deletes or spends. Clients that honour annotations ask before destructive tools run.
- Audit log: every write the agent makes is recorded with the key or the connected app, the action and the time.
- Revoking: each sign-in appears under Dashboard → Connected apps and each key under Dashboard → API keys; either can be revoked at any time.

## What can’t an agent do on Threads through Postgale?

- Send direct messages. Threads has no messaging API.
- Edit a published post. Threads allows delete, not edit.

## Questions

### Can an n8n AI agent post to Threads?

Yes, an n8n workflow can post to Threads through Postgale. Attach an MCP Client Tool node pointed at https://postgale.com/mcp to an n8n AI Agent node (or call the REST API from an HTTP Request node) with a Postgale API key, connect your Threads account in Postgale once, and the agent can text, image, video and carousel posts, reply chains and replies. A person can be required to approve every post, reply and message before it goes out.

### Does an n8n AI agent see my Threads password or tokens?

No. The account owner signs in on the platform’s own page once, and Postgale stores the resulting tokens encrypted. An n8n AI agent only holds a Postgale API key or sign-in, which you can revoke at any time.

### Can I approve what an n8n AI agent sends to Threads before it goes live?

Yes. Turn on approval for the API key it uses, the account or the whole workspace. Posts, replies and messages then wait in the Postgale dashboard until a person approves, edits or rejects them; an n8n AI agent’s own access cannot approve.

### Can an n8n AI agent schedule Threads posts?

Yes. Ask for a date and time; Postgale stores the post as scheduled and publishes it then, and reports the result (post.published or post.failed) on your webhook and in get_post.

## Related

- [n8n guide](https://postgale.com/guides/n8n)
- [Threads for AI agents](https://postgale.com/integrations/threads)
- [n8n and Instagram](https://postgale.com/guides/n8n/instagram)
- [n8n and Facebook](https://postgale.com/guides/n8n/facebook)
