Posting automatically on social media with n8n and an API

The Goal

I wanted to bridge the gap between my content ideas and actual social media publishing without manually logging into five different platforms. I’ve built a workflow that takes any trigger (Google Sheets, RSS, or Typeform) and uses the SchedPilot API to handle the AI caption generation and multi-platform scheduling automatically.

They also come with an API documentation

The Workflow

  1. Trigger: A new row in Google Sheets (topic & link).

  2. Logic: Format the data for the API.

  3. Action: Call the SchedPilot API via the HTTP Request node.

  4. Outcome: The post is AI-optimized and queued for LinkedIn, X (Twitter), and Instagram instantly.

How to set it up

To make this work, you’ll need a SchedPilot account (where you get your API key) and a standard n8n instance.

1. The HTTP Request Node Settings:

  • Method: POST

  • URL: https://api.schedpilot.com/v1/publish (or your specific endpoint)

  • Headers: Authorization: Bearer YOUR_API_KEY

  • Body: ```json { “content”: “{{$node[“Google Sheets”].json[“Topic”]}}”, “platforms”: [“linkedin”, “twitter”], “schedule_type”: “ai_optimized” }