Skip to main content
A webhook trigger is the entry point of a workflow that starts from an inbound HTTP call. You declare a path and a method on the trigger node. When you activate the workflow, Flowker serves that path and runs the workflow on every call it accepts. The trigger’s input_contract decides which payloads Flowker accepts and how it decodes them. Choose it before you write the node: it is required, and it fixes the payload format for the whole route.

Before you start


  • A workflow in draft status. An active workflow is locked, so add the trigger before you activate it. See Getting started with Flowker for the create-and-activate path.
  • The execute permission on the webhooks resource for every system you let call the path. See Securing a webhook.
  • For the xsd contract: an XSD document in the registry. Upload it with Upload an XSD schema and keep the id it returns. Your deployment also needs the XML validation service the contract validates through — see XSD_VALIDATOR_URL.
  • For the openapi contract: an OpenAPI document in the registry (Upload an OpenAPI schema, covered end to end in Connecting your own API). You also need the path and the method of the operation whose request body describes your payload. Derive an operation schema shows you that request body.

Step 1: Read the trigger contract from the catalog


Triggers are built in. You discover them in the catalog, and you never create one.
1

List the built-in triggers

List catalog triggers returns each trigger with its id, name and version. The webhook trigger’s id is webhook.
2

Read the webhook trigger's schema

Get a catalog trigger returns the same fields plus schema — the JSON Schema Flowker validates your trigger node against. Read it when you want the field list from the running instance.

Step 2: Choose the input contract


The mode fixes the route’s payload format. An xsd route is XML and an openapi route is JSON. An open route uses the format you declare, and format belongs to that mode only. Choose open when the caller’s payload has no published contract, or when you want the workflow itself to decide what is acceptable. Choose xsd when a partner sends XML that an XSD document defines. Choose openapi when a partner sends JSON and you hold the OpenAPI document that describes it.
An openapi route never accepts an unchecked payload: when Flowker cannot reach a verdict, it rejects the call with FLK-0720, and the workflow never sees that payload. An xsd route reaches its verdict through the XML validation service your deployment configures — a document that does not conform is rejected with XML_VALIDATION_FAILED, and a verdict Flowker cannot trust with FLK-0720. Configure that service before you put an xsd route in front of a caller.

Step 3: Decide how the webhook answers


On a sync route, response_view shapes the body: response_view is inert on an async route. For the full passthrough rules and for the responseStatusCode override, see Synchronous response mode.
Pick async when the caller only needs to know the event arrived. Pick sync when the caller needs the answer in the same call — a partner that expects a decision on the same connection, for example.

Step 4: Write the trigger node


The webhook trigger is a node with type: "trigger" and these fields in its data: The trigger configuration is a closed contract. Saving a workflow whose webhook trigger omits path, method or input_contract, misses a field its input_contract mode requires, names another mode’s schema id or operation field, or carries a key or a value the schema does not accept fails with FLK-0934.
Flowker registers the path with a leading slash and without a trailing one, so payments/received, /payments/received and payments/received/ all register the same route.

Step 5: Activate the workflow


1

Create the workflow

Send the node with the rest of your workflow to Create a workflow. The workflow lands in draft status, and Flowker validates the trigger configuration here — a contract error answers FLK-0934.
2

Activate it

Call Activate a workflow. Activation registers the path and the method. It also resolves what the contract references. A missing XSD schema answers FLK-0930 and a missing OpenAPI schema FLK-0931. An operation the document does not declare answers FLK-0932, and an operation with no request body answers FLK-0933.
One active workflow owns a path and method pair within your tenant. Activating a second workflow on the same pair answers FLK-0360. Deactivating a workflow releases its routes, so you can hand a path to a new version.

Step 6: Call the route and confirm it works


Send the call the way your caller will:
An async route answers 202 with the receipt:
A sync route answers with the execution’s outcome, in the shape its response_view selects. The status it carries depends on the view and on how the execution ended — Synchronous response mode holds those rules. Three signals tell you the route worked:
  • A response that started an execution carries X-Webhook-Workflow-ID and X-Webhook-Execution-ID, so you can tie a call to the workflow it reached and the execution it started.
  • Get execution results reports the step results and the final output for that executionId.
  • The execution’s input carries a _webhook object with the method, the path and the caller’s address. Use it to confirm the workflow saw the call it should. See Webhook metadata.
A repeat delivery that carries the same Idempotency-Key returns the original execution instead of starting a second one, and its body carries idempotencyReplayed: true with the original status. Send a new key to run the workflow again. The five verbs each have their own reference page: POST, GET, PUT, PATCH and DELETE.

When a call fails


A JSON route returns code, title and message. An XML route returns an <error> document. See the Flowker error list for every code and both shapes.

What’s next


Integration guide

Connect the workflow to external services, and read the full synchronous-response rules.

Workflow design guide

Build the rest of the graph the trigger enters.