As always, everything we do is API-first, so you can always use the formula platform APIs to retrieve details about an execution including all of that execution's step executions and step execution values. To view all platform APIs for formulas, click on "API Docs" in the right-hand panel.
That being said, Cloud Elements leverages those APIs for you, so sometimes it can be easier to view executions there. To do so, simply login to Cloud Elements, and click on "Executions" in the left-hand panel under the "Formulas" heading.
The GET /formulas/instances/executions/{executionId}/errors
API allows you to retrieve errors for a formula instance execution.
This API returns any steps that failed and the step execution value containing the error message.
This can also be accessed via Cloud Elements UI within the "Executions" Screen:
First off, that's not a question. Secondly, if your formula is not running, check the following:
Unfortunately, this is a very difficult question to answer. That being said, the speed of a given formula is dependent upon things like:
elementRequest
step endpoints' APIs?Some external Javascript libraries are supported. For the most up-to-date list, or to request a new library be supported, contact Cloud Elements Support.
You can set up a formula instance to send notifications for any errors via email or webhooks. This is done by setting the optional notification.email
and/or notification.webhook.url
settings when creating or updating the formula instance. You can do this via the formula instances UI or API. Both fields can be set to a single value or a comma separated list. The formula instances API payload should look like this:
{
"name": "Formula Instance Name",
"active": true,
"configuration": {
"<key>": "<value>"
},
"settings": {
"notification.email": "email1@test.com, email2@test.com",
"notification.webhook.url": "http://listener.com"
}
}
If you need to run your executions in a queue so only one execution is running per formula instance at any point in time, you can set the singleTreaded
flag to true
on the formula. This is not recommended unless it is absolutely required by your use case as it will increase the overall execution time.
Yes. There are two ways to do this, but the preferred way is using a elementRequestStream
step. The second option, using an elementRequest or httpRequest step is only supported for smaller files. If you are using our bulk APIs or downloading another large file, you need to use the elementRequestStream
step.
elementRequestStream
step (the far superior option)In a elementRequestStream
step you can move a file from one place to another. This is done in a stream and the file content is not stored in the context of the formula. In the step you will specify all the necessary parameters for both an upload and a download API call. The step will execute the download API call and stream the response body of that request to the upload API.
NOTE: You should not use this unless the file is very small and option #1 will not work for you.
If you have an elementRequest or an httpRequest step that calls an API which downloads a file, the response body will have the following format:
{
"filename": "myFile.pdf",
"type": "workflow-file-attachment",
"content": "base64 encoded string of file"
}
You can then use that same body (or modify the filename first, if you would like) as the body of an elementRequest step for an API that posts a file. You do not need to add any additional headers or parameters, just the body in this format.
If you have downloaded a file in a previous step and want to make a multipart request with that file you can do that using an elementRequest step with a body in the following format. In this example the call takes 2 form parameters, one of which is a file and the other is JSON metadata. Again, you do not need to add any additional headers or parameters to this call.
{
"parts": [
{
"name": "metaData",
"content": {
"your": "json"
},
"Content-Type": "text/plain"
},
{
"name": "file",
"filename": "myfile.jpg",
"content": "the encoded string that you got when you downloaded the file",
"Content-Type": "application/octet-stream"
}
],
"type": "workflow-multipart"
}
retryFormulaExecution
step type?The typical use cases to use a retryFormulaExecution
step type are -
request
, elementRequest
or httpRequest
step are not enough as such attempts will retry in a second or less. The formula execution as a whole needs to truncated and retried with the same input data (event, manual trigger, etc.), minutes or even hours later.Basically, any use case where the formula execution needs to wait for a few minutes or more, and retry the execution, can be accomplished using a retryFormulaExecution
step.