Skip to main content

Generate a workflow with AI

Learn how to generate a complete workflow using an AI prompt.

You can use AI to generate a fully functional workflow without the need to build it manually. You provide some instructions and Retool assembles the required blocks with any necessary logic. You can also select a database resource and provide context about table schema.

AI-generated workflows support:

  • Schedule or webhook triggers to automatically run the workflow.
  • Resource query blocks that interact with data sources, such as SQL databases.
  • JavaScript code that transform data.
  • Slack and Retool Email queries that can send notifications.
  • Webhook response blocks to send data as webhook events.

Generate a new workflow

Generating with AI overwrites the current workflow

Generating a workflow with AI overwrites any existing workflow blocks and logic you may have already created.

Click Get started in the left panel and select Generate with AI.

Retool provides a selection of sample prompts for you to get started. click Give example to cycle through different examples.

AI-generated workflows are not deployed automatically. Review and test the workflow to ensure it functions correctly.

Generate with a resource

You can specify a connected database resource, such as PostgreSQL or BigQuery. Click the Generate with a Resource dropdown, select the resource to use, then select the tables to reference.

Selecting multiple tables enables you to generate workflows that may require using data spread across different locations. For example, if you want to generate a daily report about inventory at a specific warehouse using its address, including relevant tables allows Retool to generate a workflow that looks up the warehouse ID and filter the inventory data.

Generated workflow notifications

You can specify Slack or email in the AI instructions if you want a workflow to send notifications. AI-generated workflows can add Resource query blocks for Slack and Retool Email automatically. If you do not have a Slack resource, you must connect one before you can send Slack notifications.

Generated workflow triggers

You can include instructions for triggering a workflow on a schedule or in response to a webhook. Provide details about the triggers and Retool generates a workflow with them automatically configured.

Webhook trigger instructions can also include details about any parameters to use. For example, you could generate a workflow to send a customer survey only if the webhook event contains "approved": true.