Skip to content

HTTP Request (REST)

This service task sends an HTTP request to any URL and returns the response. It acts as a universal REST connector within a BPMN process – ideal for calling external APIs, triggering webhooks, handing files over to other systems, or fetching data from third-party services.

Benefit: External systems can be integrated directly into automated workflows without custom code – including files, clean error handling, and automatic retries during short outages.


Input Parameters

Parameter Type Required Description
url String Yes The target URL (must start with http:// or https://).
method String No HTTP method: GET, POST, PUT, PATCH, DELETE. Default: GET.
headers Object No Key-value pairs sent as HTTP request headers (e.g. Authorization).
body Object / String No Request body. Objects are sent as JSON. File references inside are sent along automatically (see Sending files). Ignored for GET.
bodyType String No How the body is sent: json, multipart or file. Default: json.
resolveFiles String / Boolean No "base64" (default): file references in the body are replaced by the file. false: file references stay references.
failOnStatus Boolean / Object No true: any response outside 200–299 fails the step. { "except": [404] }: like true, but the listed status codes do not count as errors. Default: off.
retry Object No Retry on server errors and timeouts: { "attempts": 3, "delaySeconds": 10 }. See Retry.
queryParams Object No Key-value pairs appended to the URL as query parameters.
timeout Number No Timeout per attempt in milliseconds. Default: 30 000. Maximum: 60 000.
responseType String No How the response is handled: auto, json, text, binary. Default: auto. See Receiving files.
filename String No File name for a response that is stored as a file.

Example Input

{
  "url": "https://api.example.com/orders",
  "method": "POST",
  "headers": {
    "Authorization": "Bearer {{secret:API_TOKEN}}"
  },
  "body": {
    "orderId": "2024-001",
    "status": "confirmed"
  },
  "failOnStatus": true,
  "timeout": 10000
}

Credentials such as tokens are never entered in plain text. They are referenced as {{secret:NAME}} in url or headers (Authorization, X-API-Key, apikey). See Managing Secrets.


Output

Field Type Description
statusCode Number The HTTP status code of the response (e.g. 200, 404, 500).
body Object / String Response body for text and JSON responses. Parsed as JSON when possible; otherwise returned as plain text.
headers Object Response headers as key-value pairs.
file Object File responses only: file reference { referenceId, filename, contentType } of the stored file.

Example Output

{
  "statusCode": 200,
  "body": {
    "success": true,
    "message": "Order confirmed"
  },
  "headers": {
    "content-type": "application/json"
  }
}

Sending files

In the process data, files are stored as a file reference, for example from an upload field, a generated invoice, or a record:

{
  "referenceId": "01JC8Q3Z7K2M4N5P6R7S8T9V0W",
  "filename": "Invoice-2026-000123.pdf",
  "contentType": "application/pdf"
}

If such a reference appears in the body, the service task reads the file only when the request is sent and includes its content. The body is built as usual – wherever the file belongs, the reference is placed. No special syntax is required.

bodyType defines the form in which files are sent:

bodyType What is sent Typical for
json (default) JSON, each file as Base64 text in its field Webhooks, email services, many REST APIs
multipart Form upload (multipart/form-data) like a browser form; files are sent as real files with their names Document management systems, OCR services, upload APIs
file Only the file itself as the body Uploads via PUT to pre-signed links (e.g. S3) or cloud folders (WebDAV)

JSON with Base64 (default)

Input – invoice.pdf is the file reference from the process data:

{
  "url": "https://app.example.com/hooks/invoice",
  "method": "POST",
  "headers": { "Authorization": "Bearer {{secret:APP_WEBHOOK_SECRET}}" },
  "body": {
    "invoice_number": invoice.number,
    "total_cents": invoice.total_cents,
    "pdf_base64": invoice.pdf
  },
  "failOnStatus": true
}

What the receiver gets:

{
  "invoice_number": "2026-000123",
  "total_cents": 1258,
  "pdf_base64": "JVBERi0xLjcKJcfsj6IKNSAwIG9iago8PC9MZW5ndGggNiAwIFI..."
}

The reference may appear anywhere, including deeply nested objects and lists. When several files with file names are expected, as with many email services, the list is built in the mapping:

{
  "url": "https://api.mail.example.com/v1/send",
  "method": "POST",
  "body": {
    "to": [customer.email],
    "subject": "Your documents",
    "attachments": [documents.{ "filename": filename, "content": $ }]
  },
  "failOnStatus": true
}

Each entry in attachments gets its file name and, under content, the content of its file as Base64 – whether there is one file or ten. The square brackets make sure a list is created even for a single file.

If the file name is needed next to the content, it is taken from the reference, e.g. "filename": invoice.pdf.filename.

As a form (multipart)

{
  "url": "https://dms.example.com/api/documents",
  "method": "POST",
  "headers": { "Authorization": "Token {{secret:DMS_TOKEN}}" },
  "bodyType": "multipart",
  "body": {
    "document": invoice.pdf,
    "title": "Invoice " & invoice.number,
    "tags": [3, 7]
  },
  "failOnStatus": true
}

Rules for multipart:

  • Each top-level field becomes a form field.
  • A file reference becomes a file, with the file name and type from the reference.
  • Text, numbers, and yes/no values become text fields.
  • A list results in several form fields with the same name – this is also how several files are sent ("files": [file1, file2]).
  • An object is sent as JSON text.
  • Empty fields (null) are left out.
  • The Content-Type header is set by the service task; a custom Content-Type is ignored for multipart, because the upload would otherwise be unreadable.

Only the file (file)

{
  "url": upload.link,
  "method": "PUT",
  "bodyType": "file",
  "body": invoice.pdf,
  "failOnStatus": true
}

The body is exactly one file reference; only the content of the file is sent. The Content-Type is the file type from the reference (here application/pdf), unless a custom one is set in headers.

Keeping references as they are

If a reference is meant to be sent as a reference – for example to a receiver that accesses the file itself – "resolveFiles": false is set. All references in the body then stay unchanged. For single details it is also enough to take over only the fields needed, e.g. "file": invoice.pdf.filename: a single text value is never replaced.

Limits

  • All files of one request together may be at most 20 MB. Larger files cause an error before sending, stating the file name and size.
  • Base64 makes a file about one third larger. Many receivers have their own limit per request; if the receiver reports "too large", failOnStatus shows its message.
  • The file content never ends up in the process data, the result, or the logs. In the Process Explorer, the input shows only the reference.
  • GET sends no body; multipart and file require POST, PUT, PATCH, or DELETE.
  • With json, the body itself must not be just a file reference. bodyType: "file" covers that case.
  • Files are read once, even if the same reference appears several times or the request is retried.

Error handling

Without failOnStatus, the process continues even after an error response such as 404 or 500; only statusCode in the result shows the error. This is useful when the process evaluates the status itself. For webhooks and most API calls, setting failOnStatus is recommended.

failOnStatus Behaviour
missing or false No failure on error responses (as before).
true Any response outside 200–299 fails the step.
{ "except": [404] } Like true, but the listed status codes do not count as errors. The process continues and can evaluate statusCode.

The error message contains the status code and the receiver's message, for example:

HTTP 404: Account unknown

The message is read from the error or message field of a JSON response; otherwise the first 500 characters of the response are used.

What happens after the failure:

  • With an error path: If an error boundary event is attached to the service task, the process continues there, e.g. with a user task "Check transfer". See Error handling.
  • Without an error path: The instance is marked as failed with the message. In the Process Explorer it can be retried or continued with the next activity, see Actions for a process instance.

Example for except: A customer is looked up in a CRM. 404 means "does not exist yet" and should lead to creating the customer instead of failing the process. With "failOnStatus": { "except": [404] } and a gateway on statusCode = 404, both are covered; every other error still fails the step.


Retry

If the receiver is briefly unavailable, retry repeats the request automatically:

{
  "url": "https://app.example.com/hooks/invoice",
  "method": "POST",
  "body": { "invoice_number": "2026-000123" },
  "failOnStatus": true,
  "retry": { "attempts": 3, "delaySeconds": 10 }
}
Field Meaning
attempts Attempts in total, including the first call: 1 to 5. Default: 3. 1 means "never retry", not even after a timeout.
delaySeconds Pause between two attempts in seconds: 1 to 60. Default: 10.

A request is retried on:

  • server errors (500–599),
  • 429 ("too many requests"),
  • timeouts (timeout),
  • network errors (receiver not reachable).

Other 4xx responses such as 400, 401, or 404 are never retried: a wrong request stays wrong on the second attempt.

Further rules:

  • If the receiver sends a Retry-After header with 429 or 503, its waiting time is used instead of delaySeconds, at most 60 seconds.
  • After the last attempt: with failOnStatus, the step fails and the message states the number of attempts (e.g. HTTP 503: Maintenance (3 attempts)). Without failOnStatus, the last response is the result.
  • Longer waiting times (minutes or hours) are modelled in the process, e.g. with a timer and a loop.

Without retry, timeouts and network errors are tried up to three times, as before. A failure caused by failOnStatus is then never retried.

Duplicate calls

When a request is retried, the receiver may get it more than once – for example if it processed the first request but the response never arrived. Retrying is therefore suited to receivers that tolerate a duplicate call, e.g. because they recognise an invoice or case number they already know. Many APIs support a header such as Idempotency-Key for this, which is passed in headers. If the receiver does not tolerate duplicate calls, "retry": { "attempts": 1 } is set.


Receiving files

If the receiver returns a file (e.g. a PDF), it is stored automatically and returned under file as a file reference. It can then be used like any other file in the process, for example as an email attachment.

responseType Behaviour
auto (default) If the response looks like a file (file type such as PDF, image, ZIP, Office, or Content-Disposition: attachment), it is stored; otherwise it is returned under body.
binary The response is always stored as a file.
json The response is always parsed as JSON (falling back to text).
text The response is always returned as text.

The file name comes from filename, otherwise from the receiver's response or the URL. An error response is never stored as a file.

Example output:

{
  "statusCode": 200,
  "headers": { "content-type": "application/pdf" },
  "file": {
    "referenceId": "01JC8Q3Z7K2M4N5P6R7S8T9V0X",
    "filename": "delivery-note-4711.pdf",
    "contentType": "application/pdf"
  }
}

Behaviour & Limitations

  • Only http and https protocols are supported.
  • Text responses may be at most 5 MB, file responses at most 20 MB.
  • Files sent along may be at most 20 MB together.
  • If the body is an object and no Content-Type header is set, application/json is added automatically.
  • Network errors and timeouts result in a process error – they are not silently swallowed.
  • Error responses (4xx, 5xx) result in a process error only with failOnStatus.
  • Retries and pauses together take at most about 9 minutes (5 attempts with a 60-second timeout and a 60-second pause each).

Use Cases

  • Trigger a webhook when a process step completes – failing on errors and retrying during short outages.
  • Hand over invoices and documents, e.g. the generated PDF as Base64 to a business application.
  • Store documents in a document management system via form upload.
  • Upload files to pre-signed links or cloud folders.
  • Create or update records in an external CRM or ERP system.
  • Fetch real-time data (e.g. exchange rates, weather, stock levels) for downstream decisions.
  • Download files, e.g. delivery notes or reports, and use them later in the process.
  • Notify external tools (Slack, Teams, email APIs) about process events.