If a flow receives its input through an Experlogix Documents data set, the program that starts the flow can send the input data in compressed form. Compressing large payloads reduces the size of the request and allows you to send data larger than 2 MB. Uncompressed input continues to work as before.
Compressed input works with Experlogix Documents JSON data sets and, starting with Experlogix Smart Flows 4.30, with Experlogix Documents XML data sets. Flows that use other data set types as input do not accept compressed data.
Prerequisites
-
Experlogix Documents version 26.10.2 or later.
-
An Experlogix Documents connector in the Smart Flows project, and an Experlogix Documents JSON or XML data set created on this connector.
-
A flow that starts from another program and uses the Experlogix Documents data set as input. In the flow builder, under Flow input:
-
In Start this flow from, select Another program.
-
In Input is defined by this data set, select the Experlogix Documents data set.
-
-
An API key of a user who is allowed to run the flow. For more information, see API Documentation.
-
Input data that matches the structure of the flow's input data set.
Compressing the Data
To prepare the payload:
-
Save the JSON or XML data as UTF-8 text.
-
Compress the data with gzip as a single gzip stream.
-
Encode the compressed bytes with standard Base64.
The result is a single Base64 string. Do not wrap it in quotes or in a JSON object.
Sending the Request
Send the Base64 string as the request body when you start the flow.
|
Request element |
Value |
|---|---|
|
Method |
|
|
URL |
|
|
Authentication header |
|
|
Content-Type header |
|
|
Body |
The Base64 string, without quotes or a wrapper object |
Optionally, add the displayName query parameter to name the flow execution.
Do not add the Content-Encoding: gzip header. The request body is Base64 text, not raw gzip bytes.
Example
The following C# example compresses a JSON file and starts a flow with the compressed data:
var json = await File.ReadAllBytesAsync(@"C:\data\input.json");
using var compressed = new MemoryStream();
using (var gzip = new GZipStream(compressed, CompressionLevel.Optimal, leaveOpen: true))
{
await gzip.WriteAsync(json);
}
var payload = Convert.ToBase64String(compressed.ToArray());
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-KEY", "<your-api-key>");
using var content = new StringContent(payload, Encoding.UTF8, "text/plain");
var response = await client.PostAsync(
"https://<your-smart-flows-host>/api/v1/flows/executions?flowId=<flow-id>", content);
Close the gzip stream before you encode the data, as shown in the example. Otherwise, the compressed data is incomplete.
The response contains the ID of the flow execution. Use it to track the progress of the flow execution and to get its output, as described in API Documentation.
Payload Size Limits
Experlogix Documents applies the following limits to compressed input:
|
Limit |
Maximum size |
|---|---|
|
Compressed data (the Base64 string) |
2 MB |
|
Original data before compression |
20 MB |
If the data exceeds either limit, the flow execution fails. To reduce the size, remove unnecessary data or large embedded media.
Important Considerations
-
Experlogix Documents data sets only. Compressed input is supported for Experlogix Documents JSON data sets and, starting with Experlogix Smart Flows 4.30, for Experlogix Documents XML data sets. It is not supported for other data set types.
-
Supported format. Only standard Base64 of a single gzip stream is supported. Base64url encoding,
data:URI prefixes, and ZIP archives are not supported. -
Uncompressed data. You do not need to change existing integrations. Flows continue to accept uncompressed data.
Troubleshooting
A successful response from the API means that the flow execution started. It does not confirm that the data was processed. Check the status of the flow execution.
|
Problem |
Possible cause |
Solution |
|---|---|---|
|
The flow execution fails |
The flow's input data set is not an Experlogix Documents data set. |
Send uncompressed data, or change the flow input to an Experlogix Documents data set. |
|
The flow execution fails |
The data is not standard Base64 of a single gzip stream. |
Compress the data with gzip, close the stream, and encode the result with standard Base64. |
|
The flow execution fails |
The body is wrapped in quotes or in a JSON object. |
Send the Base64 string as the entire request body. |
|
The flow execution fails |
The data exceeds a size limit. |
Reduce the data. See Payload Size Limits. |
|
Field values are missing in the output |
The data structure does not match the input data set. |
Verify the data against the schema of the data set. |
Technical Details
Decompression is done by Experlogix Documents, not by Smart Flows. Smart Flows passes the compressed data to the Experlogix Documents data set without changes. Experlogix Documents detects the compressed data, decompresses it, and processes it the same way as uncompressed data.
For information about compression in Experlogix Documents itself, including compressed samples in the data set builder and compressed payloads in the Experlogix Documents OData API, see Compressing Large JSON and XML Data in the Experlogix Documents Knowledge Base.