Prepare Your Workflow

In this step we’ll set up the n8n workflow that powers your SaaS. Our example workflow receives data from a webhook and forwards it to a Telegram chat.

What You’ll Build

We’re creating a simple SaaS service where customers send data to your webhook, and the data is delivered to their Telegram channel. This will help you understand how AgentCraft connects n8n workflows with end-user actions.

What Is an n8n Workflow?

An n8n workflow is a visual automation consisting of connected nodes. Each node performs an action (receive data, transform data, call an API). When triggered, the workflow executes step by step — similar to a flowchart. In our example, one node receives a webhook, another formats data, and the last sends it to Telegram.

Our workflow contains three nodes:

  • Webhook – receives POST requests from your customers.

  • Edit Fields (Set node) – maps and formats the incoming data.

  • Telegram – sends the formatted message to a Telegram chat.

Webhook Node

  • Method: POST

  • Path: your webhook endpoint (e.g. telegram_notificator)

  • Auth: Header Auth (customers will provide their API key / token later)

Edit Fields Node

  • Maps incoming payload to body.data

  • Prepares it for Telegram output

Telegram Node

  • Chat ID: your Telegram channel or group

  • Message: pulls {{$json.body.data}} from the previous step

  • Disable Attribution: true

Creating a Telegram Bot and Adding It to n8n

  1. In Telegram, search for @BotFather and start a chat.

  2. Use /newbot to create a new bot. Follow the prompts to set a name and username.

  3. BotFather will send you an API token (keep it safe).

  4. In n8n, open Credentials → Telegram API.

  5. Paste your API token there and save.

  6. In your Telegram node, select this credential to authenticate your bot.

Once saved, n8n can send messages to your bot or channel using this token.

Test the Workflow

  • Create a Telegram Chat and connect the Bot to the Chat

  • Click Execute Workflow in n8n.

  • Send a POST request to your webhook URL with a body.data field.

  • Check that the message appears in your Telegram chat.

Once the workflow works end-to-end, you’re ready to register it in AgentCraft to turn it into a SaaS product.

Last updated