Knowledgebase

Articles

Procedures - Consuming Data from Incoming Events
In order to ensure your procedures use accurate, up-to-date data, de do not recommend using trigger.body.message.raw inside procedure steps to retrieve object information. Rather, as a best practice, we recommend using the object ID from the even...
Javascript in Procedures
You can choose from several step types that allow you to write your own custom Javascript. The function signature for all JS-related step types looks like: /** * @param trigger The trigger that started this execution * @param steps The lis...
Sub-Procedure Example that Checks if Executions are Still Running on Another Procedure
If you are looking for a way to check if a procedure is still running in order to avoid concurrency or limit the amount of procedures running at a time, we have a sample sub-procedure that can be used to check for pending procedure executions. The p...
Cause of "Unable to verify the first certificate" error in an HTTP Request Step in Procedures
The reason why you may be receiving this error is that the HTTP URL does not have a valid SSL certificate. If there is a certificate, it may be self-signed, which is not allowed in the HTTP Request step due to it being untrustworthy. To remedy this,...
What Format is Used for Cron Configuration in Procedures?
Sugar Integrate uses the Quartz format for crons.
Retrying with amqpRequest Step
If you have a service that is using the AMQP protocol and you want to build that into your procedure but there is no option to retry the step upon failure, Sugar Integrate offers a solution. The basic idea behind the httpRequest step retry step opt...
Automatic Cleanup of Temporary Procedure Instances
If temporary procedures are a part of your use case, utilize the Time To Live setting for your instances.  To use this setting, provide the amount of time a procedure instance should exist in seconds. After this amount of time has lapsed, the p...
Searching Procedure Executions
Procedure executions can be queried only by the ObjectID from the trigger of the procedure execution. You cannot query by ExecutionID. To query an ObjectID to return the expected procedure execution, the ObjectID in the trigger event must have been ...
Replaying Procedure Executions Via API
Use the PUT /formulas/instances/executions/{executionId}/retries endpoint to replay procedure executions via API.  We keep procedure executions for a minimum of three days and up to maximum of seven days, after which they can no longer be rep...
How to Reduce Procedure Execution Retry Error Notification Noise
Procedures have a step type that allows a user to retry a procedure execution in the case of an error that necessitates re-executing the entire procedure. However, if the email in the Notification Settings for a procedure instance is specified, ...
How To Manually Trigger An Events-Based Procedure
Events-based procedures are great for processing workflows based on notifications from a Poller or Webhook, but during development you may want to test the procedure manually. To do this test, you can use the minimum values required to trigger an E...
How to Build a JSON Using Strings Containing Escape Characters
Creating a JS procedure step that will result in a JSON which uses strings containing escape characters might result in different errors when running the procedure, for example: A JSONArray text must start with '[' at 1 [character 2 line 1]...
How to Use Bulk Within a Procedure
Doing bulk within a procedure can be a little difficult. Bulk by nature is an asynchronous job, while procedures are a synchronous procedure. One way to get them to work together is via webhooks. There are two ways to know when a bulk job is comple...
How can I pass data between procedure steps?
Sharing data between steps can be somewhat confusing when writing your first procedure.  All steps make data available to other steps by exposing variables with the results of executing the step.  For most step types, this is specific to t...
Can you send notifications to a webhook in a procedure step?
You can use a "httpRequest" Step to make a HTTP Request to any URL. You can choose the method to use (like POST), the headers and the body. You can also configure the expected Responses and steps on success or failure to the HTTP call. For...
Procedures - Executing Procedure Steps Asynchronously
Because procedure steps are executed serially, they cannot be executed asynchronously. There is no mechanism to cause steps within a procedure to run asynchronously.
Procedures: Why Does the Search Executions by Object ID Functionality Result in Several Executions in the Results?
T his search is looking at events.  ObjectIds are included in a particular "event" and an "event" can have many objectIds, all of which trigger executions. The result set consists of all executions that kicked off with the e...
Procedures: How the GET /executions Call Paginates through Results
The GET/elements/api-v2/formulas/instances/{instanceId}/executions call uses pagination in a dynamic way. The results of this API call do not represent a snapshot in time. If a procedure has many executions, by the time you paginate through the la...
Procedures - How to Aggregate Loop Step Results
To aggregate the results from a loop in a formula, use the last step of the loop as an aggregator. For example, you can make a Javascript step called aggregator   and use use the following code snippet: let arr = steps.aggregator ? steps.agg...
Procedure Data Context Example
Below is an example of the actual data you have access to in a procedure, and the structure of that data.  { "trigger": { }, "steps": { "stepname": { } }, "config&q...
Procedure Instance Deactivation Criteria
Procedures  that fail executions over 100 times in a 24 hour period without a single success are automatically disabled. To receive a notification when a procedure instance is disabled,  specify the  Email  address under the&n...
Procedure Traffic Distribution
Procedure traffic distribution is directly dependent on the number of procedure executions performed by the existing users under the same organization. If some users in a single organization have a high volume of procedure executions, this can direc...
Procedure Builder: Debugging Sub-Procedures From a Parent Procedure
Currently, since sub-procedures are not instantiated like procedures, they do not produce execution logs. However, since a sub-procedure is also a procedure step, the result of that sub-procedure is represented in the steps object of the parent pro...
Procedure Builder: Separating Email Addresses in Notification Settings
When specifying multiple email addresses in a procedure step or in the notification settings of the procedure instance, the email separator is the ,(comma).  For example:  df@fake.com ,dm@fake.com ...
Procedure Builder - How to set up a Variable as the Cron Trigger
Yes, this is possible by following the below steps. Set up a variable name in the same format as ${config. variableName } . In the example shown below, the variable name is ' cron '. Create a variable with the same name on the Formul...
Procedure Builder - Isolating Trigger Events
Event-based procedure execute for each single event in an event notification. For an event-driven procedure, the trigger contains an array of every object that changed, not only the object/data associated with the single execution. Event-triggered p...
Procedure Builder - Ensuring Functionality with Step Name Changes
When changing the name of a step in a procedure template, it is important to update all other references to that step in the procedure. For example, given a procedure with a script step named 'pagingQuery' and an adapter request step that re...
Procedure Builder - Stream Step Overriding File Name or Content Type
To override the default file name or content type sent in a stream step, you need to add query parameters to override these files. Here are some examples: content- file - name=YourName.csv content- file -type=test/csv ...
Procedure Builder - How to Break an Execution After a Given Step
When debugging a specific step in a procedure, if you would like to force the procedure to exit, throw an error in a script step immediately after the step you are debugging. throw new Error('exit');