Skip to content
Docs

How-to: Receive webhooks

A webhook lets an external system start one of your flows by sending an HTTP request to a URL Publicus gives you. This guide shows how to create that URL, wire it to a flow, and read the incoming request inside the run.

  • Permission to create webhooks and flows in your workspace.
  1. Open Webhooks and click New webhook.
  2. Give it a descriptive name, e.g. GitHub push events.
  3. Click Create. Publicus generates a unique URL for this webhook.
The Create webhook form: Name, Allowed IP addresses and Channel handler set to Generic (no verification)
The Create webhook form: Name, Allowed IP addresses and Channel handler set to Generic (no verification)

The webhook URL follows the pattern:

https://your-publicus.example/webhook/{workspace-id}/{webhook-id}

Copy the complete URL from under the webhook’s name, at the top of its page, with Copy. You will configure your external service to POST to this URL.

The webhook's address under its name at the top of its page, with Copy beside it
The webhook's address under its name at the top of its page, with Copy beside it

Step 2 — Wire a Webhook trigger into the flow

Section titled “Step 2 — Wire a Webhook trigger into the flow”
  1. Open Flows → New flow. The new flow starts with a Start node.

  2. Drag a Webhook node from the node picker’s Triggers — start the flow shelf onto the canvas.

  3. Connect the Webhook node’s webhook handle to Start’s trigger handle.

    A flow canvas where a Webhook node and a Schedule node both wire into Start's trigger handle, their trigger badges reading On and On · never
    A flow canvas where a Webhook node and a Schedule node both wire into Start's trigger handle, their trigger badges reading On and On · never
  4. In the side panel, set Webhook to the webhook you created.

  5. Connect Start to your first action node.

  6. Click the Webhook node’s badge on the canvas and switch Active on.

Trigger controls with the Active toggle switched on, the next scheduled run and when the trigger last fired
Trigger controls with the Active toggle switched on, the next scheduled run and when the trigger last fired

Every request to the URL now starts a run at Start. A Webhook node that is armed but not wired into Start starts nothing. Triggered runs execute the flow’s published version, or its draft until you publish it for the first time; see Triggers & arming.

The inbound HTTP request body is available as $start->payload throughout the flow. Use a Transformer to extract the fields you need:

@json($start)
{
"repo": "$.payload.repository.full_name",
"branch": "$.payload.ref",
"pusher": "$.payload.pusher.email"
}
@endjson

The rest of the request record arrives beside the body: read the redacted request headers as $start->headers, the HTTP method as $start->method, and the full URL with its query string as $start->url.

Add a ConditionalExit immediately after the Webhook node to reject malformed payloads. The condition is the exit predicate, so phrase it as the reason to stop:

condition: ($start->payload->event ?? '') == ''
message: Missing event field, ignoring this request.

This stops the flow early without raising an error, keeping your run history clean.

With withoutOverlapping: true (the default), a delivery that arrives while an earlier run of the flow is still in progress is skipped, not queued. It never runs later, and the skip is recorded on that request in the traffic log.

To skip only deliveries about the same thing (the same order, the same ticket), set overlapKey to a JSON path into the payload, such as $.objectId. If every delivery must run, set withoutOverlapping: false, and make sure downstream nodes are safe to run concurrently against shared storage.

Neither setting stops a sender that redelivers an event after its first run has finished. To run each event once, set dedupKey (Skip repeats of) to the sender’s event id, such as $.eventId. A repeat within the window, a day by default, starts nothing and says so on the traffic log (Skip repeats).

Open Webhooks, then your webhook’s Deliveries tab, to see every inbound request, its outcome, and the runs it started. The same requests appear with all other inbound traffic on the Traffic screen. This is the first place to check if requests appear to arrive but runs are not showing up in Runs.

A webhook's Deliveries table listing each inbound call with its time, method, endpoint, outcome and the number of runs it started, with View and a ⋮ row menu on each row
A webhook's Deliveries table listing each inbound call with its time, method, endpoint, outcome and the number of runs it started, with View and a ⋮ row menu on each row

Send a test request with curl:

Terminal window
curl -X POST https://your-publicus.example/webhook/YOUR_WORKSPACE_ID/YOUR_WEBHOOK_ID \
-H "Content-Type: application/json" \
-d '{"event":"push","repo":"my-repo"}'

Open Runs and verify the run completed as expected.

Parse $start->payload->ref to extract the branch name, then use a ConditionalExit to stop if the push is not to main.

Use $start->payload->email, $start->payload->name, and so on with a TableStore / Insert to persist submissions.

Check $start->payload->type in a ConditionalExit to stop on any event other than payment_intent.succeeded.