trendguru

n8n community node for TrendGuru: publish and schedule posts to Instagram, TikTok, YouTube, Facebook Pages, LinkedIn and X, upload media, read analytics and react to publishing webhooks

Package Information

Released: this month
Downloads: 0 weekly / 0 monthly
Latest Version: 0.1.1
Author: TrendGuru

Documentation

TrendGuru for n8n

An n8n community node for TrendGuru, an API that publishes and schedules posts to Instagram, TikTok, YouTube, Facebook Pages, LinkedIn and X from one request.

The package has two nodes:

  • TrendGuru creates, validates, reads, retries and deletes posts, uploads media, lists connected accounts and profiles, and reads analytics and credit usage.
  • TrendGuru Trigger starts a workflow when a post is published or fails, when one account of a post is published or fails, when an account is connected or disconnected, and on the other TrendGuru webhook events.

API reference: https://trend.guru/docs

Installation

Follow the community nodes installation guide in the n8n documentation. In n8n open Settings > Community Nodes > Install and enter the npm package name:

n8n-nodes-trendguru

Credentials

  1. Sign in at https://trend.guru and connect your social accounts in the dashboard.
  2. Open API Keys in the dashboard and create a key. Live keys start with tg_live_, test keys with tg_test_.
  3. In n8n create a TrendGuru API credential and paste the key.
Field Value
API Key The key from the dashboard
Base URL https://trend.guru/api/v1 (change it only for your own TrendGuru server)

n8n checks the credential with GET /me.

An API key carries scopes. The full preset covers everything below. The publish preset covers posts, accounts and media uploads, but not analytics or webhooks.

What you use Scope the key needs
Post: Create, Retry, Delete posts:write
Post: Validate, Get, Get Many posts:read
Account and Profile operations, the account and profile dropdowns, Platform Options keyed by network name accounts:read
Media: Upload, Delete media:write
Media: Get, Get Many posts:read
Analytics operations analytics:read
Usage: Get any key
TrendGuru Trigger webhooks:read and webhooks:write

Operations

Resource Operation What it does
Post Create Publishes now, schedules at a time or saves a draft. Text, title, media by URL or by uploaded media ID, one or many accounts, per-network options, optional Idempotency-Key, dry run
Post Validate Checks the same input against the rules of every selected network without saving anything
Post Get Returns one post with the result for every account
Post Get Many Lists posts filtered by status, network, account, profile, date range or text. Supports Return All
Post Retry Sends the failed accounts of a failed or partly published post again
Post Delete Deletes the post in TrendGuru. With Delete From Networks Too it first removes the published copies from the networks
Account Get, Get Many Connected social accounts, filtered by network, profile or status
Profile Get Many Profiles (groups of accounts), optionally with their accounts
Media Upload Uploads a file from an n8n binary field and returns a media ID
Media Get, Get Many, Delete Uploaded files
Analytics Get Account Analytics Followers, engagement and content numbers per account for the last N days
Analytics Get Top Posts Best posts of the accounts for the last N days, sorted by likes, comments, shares, views, saves or date
Usage Get Credit balance, plan, posts sent this month and prices

Creating a post

  • Publish: Now, At a Set Time (with Publish At) or Save as Draft. A value of Publish At without a time zone offset is read in the time zone of the n8n server and sent to the API in UTC.
  • Accounts: pick them from the list loaded from your workspace, or pass account IDs with an expression (an array or a comma-separated string).
  • Media: add items in order. An item is either a public URL or the ID returned by Media > Upload. A video given by URL is copied into TrendGuru storage when the post is created.
  • Platform Options (in Additional Fields) is a JSON object. Keys are network names (instagram, tiktok, youtube, facebook, twitter, linkedin) or account IDs; values are the options of that network as listed in the API reference. Options under an account ID win over options under the network name. Example:
{
  "instagram": { "kind": "reel" },
  "tiktok": { "privacy": "public" },
  "youtube": { "title": "My video", "visibility": "public" }
}
  • Idempotency Key (8 to 128 characters: letters, digits, _, ., :, -): repeating the request with the same key within 24 hours returns the first post instead of creating another one.
  • Wait for Publication: with Now the API waits for the networks by default. Turn it off to return at once and follow the result with the trigger node or Post > Get.

Uploading media

Media > Upload asks the API for an upload address (POST /media) and sends the file there. A file may be up to 50 MB on the Free plan and up to 1 GB on paid plans. Uploaded files that no post used are removed after 14 days.

Errors

When the API refuses a request, the node shows the TrendGuru message and, in the description, the code, the type, the HTTP status, the request ID and the details the API returned. With Continue On Fail the item carries error, code, type, status, requestId and details instead.

TrendGuru Trigger

When the workflow is activated the node creates a webhook in TrendGuru for the selected events and stores the signing secret that TrendGuru returns in the workflow's static data. When the workflow is deactivated the webhook is deleted.

Every delivery is checked against the TrendGuru-Signature: t=<unix>,v1=<hex> header: HMAC-SHA256 of <t>.<raw body> with the signing secret. Deliveries with a wrong signature, or signed more than 300 seconds ago (configurable), are answered with 401 and do not start the workflow.

Events: post.scheduled, post.published, post.partial, post.failed, post.canceled, target.published, target.failed, account.connected, account.disconnected, analytics.synced, trend.detected, or all of them.

Notes:

  • TrendGuru delivers only to a public https:// address, so n8n must be reachable from the internet. On a local n8n use a tunnel and set WEBHOOK_URL.
  • TrendGuru retries a failed delivery after 1 minute, 5 minutes, 15 minutes, 1 hour, 3 hours and 12 hours, and disables a webhook after 10 failures in a row. The node replaces a disabled webhook the next time the workflow is activated.
  • An event can arrive more than once. Its id (evt_...) stays the same across retries.

Workflow templates

Importable workflows are in templates/. In n8n choose Import from File, then add your credentials and pick the accounts. The templates contain no credentials and no account IDs.

File What it does
rss-to-social.json A new RSS feed item is published to the accounts you pick, with an idempotency key built from the item
drive-video-to-shorts.json A new video file in a Google Drive folder is uploaded to TrendGuru and published as a TikTok video, an Instagram Reel and a YouTube Short
sheets-content-calendar.json Rows of a Google Sheets content calendar with status ready become scheduled posts; the row is then marked scheduled with the post ID
failed-post-alert.json TrendGuru Trigger on a failed or partly published post sends a Telegram message with the reason per network (swap the last node for Slack if you prefer)
weekly-analytics-digest.json Every Monday an email with followers, posts and engagement per account for the last 7 days and the five most viewed posts (swap the last node for Slack if you prefer)

Billing

TrendGuru charges credits: 1 credit = $0.01 = one post to one network, so a post to five accounts costs 5 credits. The Free plan includes 50 credits a month; paid plans start at $9 a month for 500 credits, and one-time credit packs are available. X is open on paid plans only and costs more: 10 credits per tweet (each tweet of a thread) and 100 credits per tweet with a link. Credits are taken when a post is sent and returned if it finally fails. Reading data, validating posts and uploading media cost no credits. Usage > Get returns the current balance and prices.

Compatibility

Built with @n8n/node-cli against n8n nodes API version 1. The package has no runtime dependencies.

Development

npm install
npm run lint
npm test
npm run build
npm run dev

Resources

License

MIT

Discussion