Skip to content

Look up a supplier status from a webhook

Use this workflow when an external application needs to check whether a supplier is active. The caller supplies a supplier record key and receives the supplier number and current status.

Before you begin

Define the supplier status Business Object function. This example maps the function's SupplierId parameter. If you imported the function from OpenAPI, use the parameter name shown on the function, such as suppliers_Id.

Workflow flow

flowchart TD
    Start([Webhook receives supplierId]) --> Lookup["Business Object Function · Look up supplier status"]
    Lookup --> Result([Return the supplier number and status])

Configure the workflow

  1. Webhook. In Settings > Triggers > Webhook, add a String input named supplierId.
  2. Business Object Function. Add a node with code GET_SUPPLIER_STATUS. Select the supplier status function and map its SupplierId parameter to {{$context.$triggers.REST.$input.supplierId}}.
  3. Return. Set Return Value to {{$context.$nodes.GET_SUPPLIER_STATUS.$output}}.

Run the example from a webhook

Publish the workflow and invoke it through its webhook. Use a valid supplier record key in place of the sample key 1716. Poll the job status and read the workflow result from output when status is COMPLETE.

Sample request

{
  "invocationMode": "END_USER",
  "message": "Look up the supplier status.",
  "parameters": {
    "supplierId": "1716"
  }
}

Sample workflow output

{
  "SupplierNumber": "8057",
  "Status": "ACTIVE"
}

If a later node needs just the status, map {{$context.$nodes.GET_SUPPLIER_STATUS.$output.Status}}.

Expected behavior

Scenario Expected behavior
Valid supplier key The result identifies the requested supplier and includes its status.
Missing supplier key Input validation reports that the key is required before the lookup runs.
Unknown supplier key The workflow handles the endpoint's not-found response and reports that the supplier could not be found.

Add input validation and an error handler to handle missing and unknown keys.

Related guides
Webhook settings · Business Objects · Business Object Function