Introduction to Formulas

In Cloud Elements, you can build formula templates, reusable workflow templates that are independent of API providers. Formula templates include triggers, such as events or schedules, that kick off a series of steps. Formulas support a large variety of different use cases across different services. For example, they can keep systems in sync, migrate data between systems, or automate business workflows.

After you build formula templates, you can use the templates to create formula instances. In formula instances, you replace the variables in the templates with actual elements and values.

Formulas are a great way to move the logic out of your apps and into Cloud Elements. This helps keep your code less complex and more maintainable so you can focus on meeting your customers' needs.

Example

We give detailed examples of formulas in the Examples article, but to help you understand the power of formulas, here's a common example.

A common use case is keeping contacts synced across many systems. You might need to make sure that whenever a contact is added to Salesforce, it also syncs to HubSpot. To do this, you must first transform the data. Then, create a formula template that listens for updates to contacts in one API provider, and then pushes those contacts to another. After you set up the template, create a formula instance where you plug in Salesforce as the source element and HubSpot as the target element.

Definitions

To help you understand formulas, review the definitions in this section.

formula template
A reusable workflow that is independent of the element and includes the triggers, steps, and variables for a formula instance to execute the workflow.
formula instance
A specific instance of a formula template configured with explicit variables and associated with specific element instances.
trigger
An action that occurs and kicks off a formula. Triggers can be events set up on an element instance, an API call to an element instance, a scheduled occurrence, or manually triggered.
step
An individual step within a formula workflow that can include branches to subsequent success and failure steps.
variable
Variables that represent either element instances or specific values that must be supplied for each formula instance.

Working with Formulas

Formula Execution Timeouts

The maximum time that a formula execution without sub-formula steps can run is 100 minutes. Although some executions could run for longer than 100 minutes, there are no guarantees that the execution will complete if it runs for longer than 100 minutes.

Restarting Formulas Mid-subformula

If a formula execution stops or times out during an in-progress sub-formula step, the parent formula will restart from the beginning of the subformula, regardless of how much of the subformula was completed.

Formula Step Timeouts

For consistent performance, a single formula step should not last longer than 5 minutes.