Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.sellfern.com/llms.txt

Use this file to discover all available pages before exploring further.

Sellfern provides a ready-made n8n workflow that fetches your weekly analytics and posts a formatted report to Discord or Slack automatically — no code required. Import the workflow template, add your credentials, and your team receives a revenue summary every Monday at 9am.

What the workflow does

The workflow contains four nodes that run in sequence:
  1. Schedule trigger — fires every Monday at 9:00am
  2. Get Sellfern Analytics — calls GET /api/v2/analytics/summary?period=last_7_days with your API token
  3. Format Report — transforms the response into a human-readable message with revenue, order count, COGS, gross profit, and margin percentage
  4. Post to Discord — sends the formatted message to your Discord (or Slack) webhook URL
The formatted output looks like this:
Sellfern Weekly Revenue Report
Period: last_7_days (2026-05-15 – 2026-05-22)

Revenue:       $12,450.00
Orders:        87
COGS:          $7,890.00
Gross Profit:  $4,560.00
Margin:        36.6%

Prerequisites

  • An n8n instance (self-hosted or n8n Cloud)
  • A Sellfern API token with the analytics:read scope
  • A Discord webhook URL or Slack incoming webhook URL

Importing the workflow

1

Open the Import dialog

In n8n, go to Workflows in the left sidebar and click + Add workflow, then select Import from file.
2

Upload the workflow file

Upload examples/n8n-weekly-report.json from the Sellfern repository. n8n imports all four nodes and their connections automatically.
3

Add your Sellfern API token as a credential

Click the Get Sellfern Analytics node. Under Authentication, create a new Header Auth credential:
  • Name: Authorization
  • Value: Bearer sk_live_YOUR_TOKEN
Save the credential. n8n stores it securely and reuses it for all Sellfern HTTP nodes.
4

Set your webhook URL

Click the Post to Discord node and set the URL field to your Discord webhook URL. If you are using Slack, replace this node with n8n’s Slack node (or an HTTP Request node posting to your Slack incoming webhook URL) and set the body to { "text": "{{$json.content}}" }.
5

Activate the workflow

Toggle the workflow to Active. n8n will run it every Monday at 9:00am according to the schedule trigger. The first execution happens at the next scheduled time.
Before activating, use n8n’s Test workflow button to run the workflow immediately and verify that the API call succeeds and the message appears in your Discord or Slack channel. This lets you catch credential or formatting issues without waiting until Monday.

Customizing the workflow

Changing the schedule Click the Every Monday 9am trigger node and adjust the day and time. For example, to run every weekday at 8am, set triggerAtWeekday to [1, 2, 3, 4, 5] and triggerAtHour to 8. Adjusting the report format Open the Format Report code node. The JavaScript there builds the message line by line from the API response fields (revenue, order_count, cogs, gross_profit, margin_pct). Edit the lines array to add, remove, or reformat any field. Switching from Discord to Slack Replace the Post to Discord node with an HTTP Request node pointed at your Slack incoming webhook URL. Change the request body to:
{
  "text": "={{$json.content}}"
}
The Format Report node output is the same regardless of the destination.
The workflow calls GET /api/v2/analytics/summary with period=last_7_days. Your Sellfern API token must have the analytics:read scope. You can verify your token’s scopes in Settings → API Tokens.