Ask AI
Skip to main content

Execute action

Function: Execute action

This function allows you to run another pre-defined action from within your current workflow or action. It's like calling a sub-routine or a nested process. This is useful for reusing common logic, breaking down complex tasks, or orchestrating multiple actions together.

Input,

  • Action: The specific action you want to execute. You will select this from a list of available actions in your application. This is a required input.
  • Action parameters: These are the specific inputs required by the action you selected. For example, if you choose an action that sends an email, these parameters might include the recipient's email address, subject, and body. The available parameters will change based on the "Action" you choose.
  • Mode: This determines how the action will run. You can select one of the following options from a dropdown:
    • Default (runs synchronously): The current workflow will pause and wait for the selected action to complete before continuing.
    • Asynchronous execution: The selected action will start running in the background, and your current workflow will continue immediately without waiting for it to finish.
    • Asynchronous with frontend answer: Similar to asynchronous execution, but it also allows the executed action to send updates or results back to the user interface.
  • Cache results: If set to True, the results of this action will be stored temporarily. If the same action is called again with the exact same input parameters within the cache duration, the stored results will be used instead of running the action again. This can speed up your application. (Default: False)
  • Cache TTL: This is the duration, in milliseconds, for which the action's results will be cached. This option only appears if "Cache results" is set to True. (Default: 60000 milliseconds, which is 1 minute)

Output,

  • Action outputs: These are the results or data generated by the action that was executed. For example, if the executed action created a new record, its outputs might include the ID of the new record. The specific outputs will depend on the "Action" you chose.

Execution Flow,

Real-Life Examples,

Example 1: Reusing a "Send Welcome Email" action

  • Scenario: After a new user signs up through a form, you want to automatically send them a welcome email. You already have a separate "Send Welcome Email" action defined in your application.
  • Inputs:
    • Action: "Send Welcome Email" (selected from your list of actions)
    • Action parameters:
      • RecipientEmail: \{\{NewUser.EmailAddress\}\} (assuming NewUser is data from a previous step in your workflow)
      • Subject: "Welcome to our platform!"
      • Body: "Hello {{NewUser.FirstName}}, thank you for joining!"
    • Mode: Default \(runs synchronously\)
    • Cache results: False
  • Result: The "Send Welcome Email" action is executed immediately, sending a personalized welcome email to the new user. Your current workflow waits for the email to be sent before moving to the next step.

Example 2: Processing an order asynchronously with caching

  • Scenario: When a customer places an order, you want to initiate a complex order processing action that might take some time (e.g., checking inventory, updating databases). You don't want the customer to wait, so the processing should happen in the background. Additionally, if certain sub-processes within the order processing are identical for multiple orders within a short period, you want to use cached results to speed things up.
  • Inputs:
    • Action: "Process Customer Order"
    • Action parameters:
      • OrderID: \{\{CurrentOrder.ID\}\}
      • CustomerDetails: \{\{CurrentOrder.CustomerInfo\}\}
    • Mode: Asynchronous execution
    • Cache results: True
    • Cache TTL: 300000 (5 minutes)
  • Result: The "Process Customer Order" action starts running in the background. Your main workflow continues immediately, perhaps showing a "Order received!" message to the customer. If parts of the order processing action involve fetching data that has been recently fetched for another identical order, the cached data will be used, speeding up the overall process without re-executing those specific steps.

Example 3: Updating a dashboard and getting results for display

  • Scenario: After a large data import completes, you want to trigger an action that recalculates key performance indicators (KPIs) and updates a dashboard. You also need to know if the KPI recalculation was successful and get a link to the updated dashboard to show to the user.
  • Inputs:
    • Action: "Recalculate KPIs and Update Dashboard"
    • Action parameters:
      • DatasetID: \{\{ImportResult.DatasetID\}\} (the ID of the newly imported data)
      • ReportingPeriod: "Current Month"
    • Mode: Asynchronous with frontend answer
    • Cache results: False
  • Result: The "Recalculate KPIs and Update Dashboard" action runs in the background. Your main workflow continues. Once the KPI recalculation is complete, the "Action outputs" will contain a SuccessStatus (e.g., True or False) and potentially a DashboardURL. These outputs can then be used by other parts of your application, for example, to display a success message and a clickable link to the updated dashboard directly in the user's browser.