Skip to main content

Import and run a workflow from an app

You can run Retool Workflows from apps and classic apps. This is useful for reducing complexity as it enables you to:

  • Break down complex sets of queries into more manageable functions that perform specific actions (e.g., perform multiple API requests).
  • Reuse the same actions across multiple apps, reducing the amount of duplication (e.g., transform and store data in Retool Vectors).

The app triggers the specified workflow, passing the provided data for it to use. If the workflow produces data, it is returned back to the current app.

Best practice

You can also run another workflow from a workflow. Use the Workflow block within a workflow for the same functionality described here.

To trigger a workflow from your app, open the Chat tab and prompt your agent with the workflow's name:

Update my app so that the Customer Feedback table retrieves data using the Retrieve Survey Feedback workflow.
Create a new app that tracks our quarterly sales KPIs. For the data, use the Calculate Conversion Rate workflow as well as the lifetime_value and quota_attainment tables in @Retool Database.

The triggered workflow is run on behalf of the app's authenticated user.

Return data to the app

Workflows run from within an app or classic app operate in a similar way to a webhook-triggered workflow.

In order to make data from the workflow available to the app, you must include a Response block in the workflow. The data returned from the Response block is sent to the app once the workflow run completes (available as startTrigger.data for classic app users). If you want to trigger a workflow without returning data back to the app, you don't need a Response block.