Skip to main content
Question

Workflow REST call, Handling large request body

  • April 28, 2026
  • 0 replies
  • 8 views

We are using BPA Workflows in IFS Cloud version 25R2 for some of our integrations. We are having trouble with some of our workflows that sends “large” payloads to an external REST API.

Here I am trying to use an IFS REST call task to send a message to our integration with a payload that is approximately 20-50kB. In my initial version of the workflow the message is sent, but the workflow ends with the error: 
An exception occurred in the persistence layer. Please check the server logs for a detailed message and the entire exception stack trace.

Initial IFS REST call configuration

I have a script task with the following java script for creating the request body:

//Generate request body
var payload= {
AgreementId:execution.getVariable("AgreementId"),
CustomerId: execution.getVariable("CustomerNo"),
ValidCustomers: execution.getVariable("ValidCustomers") || [],
State: execution.getVariable("AgreementStatus"),
ValidFrom: execution.getVariable("AgreementValidFrom"),
ValidUntil: execution.getVariable("AgreementValidUntil"),
PartDiscount: execution.getVariable("PartDiscount") || [],
GroupDiscount: execution.getVariable("GroupDiscount") || []
}

//Save request body to context
execution.setVariable('requestBody',JSON.stringify(payload));

I have read  in this thread, REST Call Task Request Body Size Limitation, that a workaround is to add the Output ifsBpaHttpConnectionBody and set it to null to avoid storing the request body, but that didn't make any difference.

Updated IFS REST call configuration with ifsBpaHttpConnectionBody = null

However in the same thread I can also see that the Request body seems to be set to a Spin object like this: ${JSON(requestBodySpin).toString()}.

So I tried this script task instead (with a simplied body) which should store the request body as a spin object:

//Generate request body
var SpinJSON = org.camunda.spin.Spin.JSON;
var requestBody = SpinJSON("{}");

requestBody.prop("AgreementId", "1");
requestBody.prop("CustomerId", "12345");

//Store as object (MAP)
execution.setVariable("requestBodySpin",requestBody);

This instead throws the following error at the script task:
The Camunda Attribute requestBodySpin has a type of STRING but the provided value does not match that type.

The variable name is not used anywhere before this script task, but the engine somehow thinks it is a string.

Any help for configuring a REST call for this is much appreciated.