Workflows & Automations
introduction workflows let you automate actions when something happens in a sparklayer form β for example sending notifications, updating data, or triggering internal processes instead of building manual processes around form submissions, workflows allow you to create automated flows using a visual editor typical sparklayer use cases include trade account approvals internal notifications order request processing conditional routing based on customer data please note that creating and editing of workflows is only available on the pro plan and above π§ what is a workflow? a workflow is an automated sequence that runs when an event occurs every workflow follows a simple structure trigger β step β step β step β end each workflow contains component description trigger the event that starts the workflow steps actions performed after the trigger connections paths that link steps together workflows are created visually by connecting nodes together on a canvas if you chose to receive notifications on new submissions when creating a form, then your form already has a workflow! click on the workflows tab to see it available triggers triggers define when a workflow starts trigger use this to form submitted run the workflow when a form is completed and submitted entry created run the workflow when a new entry is created (user starts filling out the form) answer updated run the workflow when one or more selected form answers change internal field updated run the workflow when one or more selected internal fields change page loaded run the workflow when a selected form page is loaded button clicked run the workflow when a button field on the form is clicked internal button clicked run the workflow when an internal fields button field is clicked by an admin user api request run the workflow when it is triggered by an api request common examples send an internal notification when a form is submitted recalculate a value when an answer changes start an approval process when an internal button is clicked update internal fields when an admin changes review data trigger a workflow from another system using an api request available steps steps define what the workflow does after the trigger runs step what it does send email sends an email to one or more recipients condition branches the workflow based on rules calculation performs calculations using numbers, formulas, and data references for each loop repeats a set of steps for each item in a list, such as line items, repeatable fields, or data table rows update entry or row updates a field value on a form entry or data table row clear answer clears one or more values from a form entry or data table row useful when a value should be reset after related data changes read/unread entry marks an entry as read or unread create entry or row creates a new form entry or data table row delete entry or row deletes a form entry or data table row api request sends an http request to an external system get customer looks up an existing sparklayer customer by id, platform id, or email create customer creates a customer in the ecommerce platform and sparklayer update customer updates an existing sparklayer customer step paths some steps have multiple paths paths control what happens next step paths condition true, false for each loop loop body for each iteration, after loop api request success, error get customer found, not found, error create customer success, error update customer success, error most other steps next example an api request can continue on the success path if the request works, or follow the error path if the request fails choosing the right step use condition when the workflow needs to make a decision use calculation when you need to calculate totals, scores, discounts, or other numeric values use update entry or row when you want to write a value back into the current entry, an internal field, another form entry, or a data table row use clear answer when a previous value is no longer valid and should be removed this is useful for dependent fields, such as clearing a selected option after the field that controls its available options changes use for each loop when you need to process every item in a list, such as repeatable fields, line items, or filtered data table rows use api request when another system needs to receive form or workflow data use the sparklayer customer steps when the workflow needs to find, create, or update customer account data π creating a workflow to create a workflow open your form in sparklayer go to the workflows tab click add workflow the visual editor will open add a trigger triggers define when the workflow runs examples form submitted entry answer updated internal field updated workflow trigger button clicked to add a trigger click add trigger on the canvas select the trigger type configure any options steps can use data references docid\ bj9tb3gn vybi1 ehm4rd to read and write values to current entry, workflow run data, and other data sources add steps steps define what happens after the trigger to add a step click the add step button, or drag the path handle out from an existing step choose a step type configure the action connect to additional steps if needed you can build simple linear workflows or create branches using conditions π§Ύ publishing workflows workflows are part of your form version this means changes remain in draft until published the live workflow only updates when the form version is published older entries continue using the workflow version they were created with to activate a workflow save your changes publish the form version this keeps automation stable even while you make updates π understanding the workflow canvas the workflow editor uses a visual canvas where you arrange nodes and connections navigation action how it works pan click and drag zoom scroll or use controls select node click the node multi select shift + click or drag nodes nodes represent triggers and steps node type purpose trigger nodes starting point for workflows step nodes actions performed during execution connections paths between nodes click a node to edit settings view input/output data delete or reconnect it π connecting steps you connect steps by dragging from one node to another connection types path meaning next continue to the next step true / false conditional branching error run when a step fails loop used in repeat processes a single step can branch into multiple paths, allowing complex automation flows βοΈ how workflows run workflows execute synchronously , meaning steps run one after another in order execution flow trigger fires steps execute sequentially entry data updates workflow completes during execution, workflows can access entry data form structure outputs from previous steps data tables or stored values π workflow runs & history every time a workflow runs, sparklayer records a run log viewing workflow runs open an entry go to workflow runs select a run to view details each run includes data description start & end time when execution occurred duration total runtime status completed or failed step logs inputs, outputs, and results this helps diagnose issues without needing developer access π§ͺ debugging workflows when something doesnβt work as expected open the workflow run review each step check error messages or failed conditions adjust the workflow or entry data you can see exactly which path was taken through the workflow β including conditional branches π§© example workflow patterns π© simple notification trigger form submitted β send internal email π conditional routing trigger form submitted β if category = sales β notify sales team else β notify support team π§Ύ multi step approval process trigger form submitted β calculate totals β update entry fields β send confirmation email β if total > threshold β request approval π§Ύ dependent field reset use this pattern when one field controls the valid options for another field example a customer selects a country a second field shows regions for that country if the customer changes the country, the previously selected region may no longer be valid, so the workflow clears it pattern trigger answer updated β answer changed country β clear answer region β the user can now select a valid region for the new country common uses country β region customer group β available products product category β product department β approval reason order type β required supporting details π‘ best practices keep workflows focused one workflow per process avoid combining unrelated automation use clear naming test before publishing use preview mode submit test entries check workflow runs for errors plan for errors add error paths where needed log important outputs avoid breaking critical workflows optimise performance limit unnecessary api calls avoid overly long step chains keep automation logic clear and maintainable