Custom server setup guide

FlowTrigger is not limited to automation platforms like n8n, Make, or Zapier. It works with any URL that accepts HTTP requests. If you have a server, a cloud function, a REST API, or any endpoint that can receive POST requests, FlowTrigger can send data to it. This guide covers everything you need to set up a custom webhook endpoint.

Can I use FlowTrigger with my own server?

Yes. FlowTrigger sends standard HTTP requests, so any server that can handle incoming HTTP requests works as a FlowTrigger endpoint. There is no proprietary protocol, no SDK, and no special integration required.

Your server needs to:

  1. Have a publicly accessible URL (or be reachable from your phone’s network).
  2. Accept POST requests (or whichever HTTP method you configure in FlowTrigger).
  3. Parse incoming JSON or multipart/form-data request bodies.
  4. Optionally return a JSON response (required for chat triggers to display a reply).

Compatible with any backend:

  • Node.js — Express, Fastify, Hapi, or the built-in http module.
  • Python — Flask, FastAPI, Django, or any WSGI/ASGI framework.
  • Go — net/http, Gin, Echo, or Fiber.
  • PHP — Laravel, Symfony, or plain PHP.
  • Ruby — Rails, Sinatra, or Rack.
  • Serverless — AWS Lambda, Google Cloud Functions, Azure Functions, Cloudflare Workers, Vercel Functions.

Setup in FlowTrigger:

  1. Create any trigger type.
  2. Paste your server’s endpoint URL.
  3. Save and send a test request.

What format does FlowTrigger send data in?

FlowTrigger uses two content types depending on the trigger type and whether files are attached:

Trigger TypeContent-TypePayload documentation
Manual (text only)application/jsonManual triggers
Manual (with files)multipart/form-dataManual triggers
Chatapplication/jsonChat triggers
Notificationapplication/jsonNotification triggers
Locationapplication/jsonLocation triggers

When files are attached (photo or audio from manual triggers), the content type is multipart/form-data. All field names are customizable in FlowTrigger’s Advanced tab.

How do I set up authentication for custom endpoints?

FlowTrigger supports two authentication methods in its advanced trigger settings, so you can protect your endpoints from unauthorized requests.

Basic Authentication:

  1. Open your trigger’s advanced settings in FlowTrigger.
  2. Enable Basic Auth.
  3. Enter a username and password.
  4. FlowTrigger sends the standard Authorization: Basic <base64-encoded credentials> header with every request.

On your server, validate the header by decoding the Base64 string and checking the credentials. Most web frameworks have built-in middleware for Basic Auth.

Header Authentication:

  1. Open your trigger’s advanced settings.
  2. Add a User Header Field.
  3. Enter the header name (e.g., X-API-Key, Authorization, or any custom name).
  4. Enter the header value (e.g., your API key or bearer token).
  5. FlowTrigger includes this header in every request.

On your server, check for the header and validate its value. This method is flexible — you can use it for API keys, bearer tokens, or any custom authentication scheme.

Which method to choose:

  • Use Basic Auth if your server expects standard HTTP Basic Authentication.
  • Use Header Auth if your server uses API keys, bearer tokens, or any custom authentication header.

How do I add custom headers to requests?

Beyond authentication headers, FlowTrigger lets you add any number of custom headers to outgoing requests.

Adding custom headers:

  1. Open your trigger’s advanced settings.
  2. Scroll to User Header Fields.
  3. Tap Add to create a new header entry.
  4. Enter the header name and header value.
  5. Repeat for as many headers as you need.

Common use cases for custom headers:

  • API keys: X-API-Key: your-key-here for services that authenticate via headers.
  • Content negotiation: Accept: application/json to specify the expected response format.
  • Custom tracking: X-Source: flowtrigger or X-Device-ID: my-phone to identify the request source.
  • CORS preflight: While typically a server-side concern, some proxies require specific origin headers.
  • Webhook signatures: Some platforms require a specific signature header for webhook verification.

Headers are sent with every request from that trigger. Each trigger can have its own set of custom headers.

How do I add custom JSON fields to the request body?

FlowTrigger lets you add extra key-value pairs to the JSON request body, which are sent alongside the standard trigger fields.

Adding custom JSON fields:

  1. Open your trigger’s advanced settings.
  2. Scroll to User JSON Fields.
  3. Tap Add to create a new field entry.
  4. Enter the key (field name) and value.
  5. Repeat for as many fields as you need.

Example use cases:

  • Source identification: Add "source": "mobile" to distinguish FlowTrigger requests from other webhook sources.
  • User tagging: Add "userId": "john" or "deviceName": "work-phone" to identify who sent the request.
  • Routing keys: Add "category": "expense" or "priority": "high" for server-side routing logic.
  • API parameters: Add fields your endpoint expects, such as "format": "detailed" or "language": "en".

How custom fields appear in the payload:

Custom JSON fields are appended at the top level of the request body. For example, a manual trigger with text input and two custom fields:

{
  "textInput": "Lunch at cafe — $12.50",
  "source": "mobile",
  "category": "expense"
}

Custom fields work with all trigger types. For multipart/form-data requests (manual triggers with files), custom fields are sent as additional form fields.

Can I change the HTTP method?

Yes. FlowTrigger defaults to POST but supports other HTTP methods for flexibility with different APIs.

Available HTTP methods:

  • POST (default) — Standard for sending data to webhooks. Request body contains the trigger data.
  • GET — Typically used for fetching data. Note: GET requests conventionally do not include a request body. FlowTrigger sends trigger data as URL query parameters instead.
  • PUT — Used for updating/replacing a resource. Request body contains the trigger data.
  • PATCH — Used for partial updates to a resource. Request body contains the trigger data.
  • DELETE — Used for removing a resource.

Changing the method:

  1. Open your trigger’s advanced settings.
  2. Select the desired HTTP Method from the dropdown.
  3. Save the trigger.

When to use a different method:

  • Most webhook endpoints (n8n, Make, Zapier) expect POST — keep the default.
  • If you are integrating with a REST API that expects PUT or PATCH for updates, change the method accordingly.
  • Use GET only if your endpoint specifically expects query parameters instead of a request body.

How do I receive FlowTrigger data in a Node.js/Express server?

Here is a minimal Express server that receives FlowTrigger data:

Text/JSON data (chat, notification, location, or manual without files):

const express = require('express');
const app = express();

app.use(express.json());

app.post('/webhook', (req, res) => {
  const { textInput } = req.body;
  console.log('Received:', textInput);

  // Process the data as needed
  // For chat triggers, return a response:
  res.json({ output: 'Message received and processed.' });
});

app.listen(3000, () => {
  console.log('Webhook server running on port 3000');
});

File uploads (manual triggers with photos/audio):

Use the multer middleware to handle multipart/form-data:

const express = require('express');
const multer = require('multer');
const upload = multer({ dest: 'uploads/' });

const app = express();

app.post('/webhook', upload.fields([
  { name: 'photoInput', maxCount: 1 },
  { name: 'audioInput', maxCount: 1 }
]), (req, res) => {
  const textInput = req.body.textInput;
  const photo = req.files?.photoInput?.[0];
  const audio = req.files?.audioInput?.[0];

  console.log('Text:', textInput);
  if (photo) console.log('Photo saved to:', photo.path);
  if (audio) console.log('Audio saved to:', audio.path);

  res.json({ status: 'ok' });
});

app.listen(3000);

Tip: For a chat trigger endpoint, make sure your response JSON includes the field name that matches FlowTrigger’s Chat Response Field setting (default is output).

How do I receive FlowTrigger data in a Python server?

Here is a minimal Flask server that receives FlowTrigger data:

Text/JSON data:

from flask import Flask, request, jsonify

app = Flask(__name__)

@app.route('/webhook', methods=['POST'])
def webhook():
    data = request.json
    print('Received:', data)

    # Access specific fields
    text_input = data.get('textInput', '')

    # For chat triggers, return a response:
    return jsonify({'output': 'Message received and processed.'})

if __name__ == '__main__':
    app.run(port=3000)

File uploads with Flask:

from flask import Flask, request, jsonify
import os

app = Flask(__name__)

@app.route('/webhook', methods=['POST'])
def webhook():
    text_input = request.form.get('textInput', '')
    print('Text:', text_input)

    photo = request.files.get('photoInput')
    if photo:
        photo.save(os.path.join('uploads', photo.filename))
        print('Photo saved:', photo.filename)

    audio = request.files.get('audioInput')
    if audio:
        audio.save(os.path.join('uploads', audio.filename))
        print('Audio saved:', audio.filename)

    return jsonify({'status': 'ok'})

if __name__ == '__main__':
    app.run(port=3000)

FastAPI alternative:

from fastapi import FastAPI, UploadFile, File, Form
from typing import Optional

app = FastAPI()

@app.post('/webhook')
async def webhook(
    textInput: Optional[str] = Form(None),
    photoInput: Optional[UploadFile] = File(None),
    audioInput: Optional[UploadFile] = File(None)
):
    if textInput:
        print('Text:', textInput)
    if photoInput:
        contents = await photoInput.read()
        print('Photo size:', len(contents), 'bytes')
    if audioInput:
        contents = await audioInput.read()
        print('Audio size:', len(contents), 'bytes')

    return {'output': 'Data received successfully.'}

Tip: For production deployments, use a WSGI server like Gunicorn (Flask) or an ASGI server like Uvicorn (FastAPI) behind a reverse proxy with HTTPS enabled.

Can I use FlowTrigger with Home Assistant?

Yes. In Home Assistant, go to Settings → Automations → Create Automation and add a “Webhook” trigger. Home Assistant generates a webhook ID — your full URL will be https://your-ha-instance/api/webhook/your-webhook-id. Paste this URL into FlowTrigger. Use location triggers for presence detection (e.g., turn on lights when you arrive home), manual triggers for controlling devices with a button press, or notification triggers to forward alerts to your smart home.

Can I use FlowTrigger with Node-RED?

Yes. In Node-RED, drag an “http in” node onto your flow, set the Method to POST, and define a URL path (e.g., /webhook/flowtrigger). Connect it to your processing nodes and add an “http response” node to return a status code. Deploy the flow. Your webhook URL will be http://your-server:1880/webhook/flowtrigger. Ensure your Node-RED instance is accessible from the internet if you are running it locally (via reverse proxy, Cloudflare Tunnel, or ngrok).

Can I use FlowTrigger with IFTTT?

Yes, with limitations. IFTTT supports incoming webhooks through its “Webhooks” service. Go to IFTTT → My Services → Webhooks → Documentation to find your unique key and URL format: https://maker.ifttt.com/trigger/{event}/json/with/key/{key}. Note that IFTTT only supports three predefined value fields (value1, value2, value3), so you may need to configure FlowTrigger’s custom JSON fields in the Advanced tab to match this format.

Can I send data to Google Sheets using FlowTrigger?

Yes, indirectly. Create a workflow in n8n, Make, or Zapier with a Webhook trigger connected to a Google Sheets node/module. Alternatively, create a Google Apps Script web app that accepts POST requests and writes directly to a spreadsheet — deploy it as a web app and use the script URL in FlowTrigger.

Can I trigger a Slack message from FlowTrigger?

Yes. Option 1 (recommended): Create a workflow in your automation platform that receives the FlowTrigger webhook and sends a Slack message using the platform’s Slack integration. Option 2 (direct): Use Slack’s Incoming Webhook URL directly in FlowTrigger and configure a custom JSON field in the Advanced tab as {"text": "Your message here"}.