Unlock the power of Retool Workflows in your Custom GPTs with this step-by-step guide. Send natural language inputs via webhooks, process them in Retool, and get JSON responses back to ChatGPT. Perfect for custom code, vector searches, and internal service access.
## Introduction
This guide offers developers a clear walkthrough for creating a GPT Action tailored to Retool Workflows. Before diving in, ensure you're familiar with these essentials:
- Introduction to GPT Actions
- Introduction to GPT Actions Library
- Example of Building a GPT Action from Scratch
This specific GPT Action demonstrates how to link ChatGPT to a **Retool Workflow**. It captures user input and forwards it to the Retool workflow through a webhook trigger. Retool executes the defined workflow and returns a JSON response to ChatGPT.
### Value + Example Business Use Cases
**Value**: Harness ChatGPT's natural language processing to directly interface with any Retool workflow.
**Example Use Cases**:
- Incorporate custom code from a Retool workflow into a GPT.
- Data Scientists managing an external VectorDB (via Retool Vector or another provider) can pipe vector search results back to ChatGPT.
- Use Retool as middleware for internal services, leveraging webhooks to expose them to ChatGPT.
## Application Information
### Application Key Links
Explore these resources from the application to prepare:
- Application Website: https://retool.com/products/workflows
- Application API Documentation: https://docs.retool.com/workflows
### Application Prerequisites
In your Retool environment, complete these setup steps first:
- Set up a Retool account
- Create a simple workflow
### Application Workflow Steps
Here's an illustration of a straightforward Retool Workflow. It receives two values, adds them together, and replies to the webhook trigger with the outcome.
***Note:*** Your workflow must be deployed before it will be accessible from your GPT.
## ChatGPT Steps
### Custom GPT Instructions
After setting up your Custom GPT, include Instructions that outline the GPT's role and available actions. Need more details? Refer to the Getting Started Example for a deeper dive.
### OpenAPI Schema
In your Custom GPT's Actions panel, paste the following text. For more guidance, check the Getting Started Example.
***Note:*** Replace the **<WORKFLOW_ID>** placeholder in the OpenAPI spec below with your actual workflow ID.
```
openapi: 3.1.0
info:
title: Retool Workflow API
description: API for interacting with Retool workflows.
version: 1.0.0
servers:
- url: https://api.retool.com/v1
description: Main (production) server
paths:
/workflows/<WORKFLOW_ID>/startTrigger:
post:
operationId: add_numbers
summary: Takes 2 numbers and adds them.
description: Initiates a workflow in Retool by triggering a specific workflow ID.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
first:
type: integer
description: First parameter for the workflow.
second:
type: integer
description: Second parameter for the workflow.
responses:
"200":
description: Workflow triggered successfully.
"400":
description: Bad Request - Invalid parameters or missing data.
"401":
description: Unauthorized - Invalid or missing API key.
security:
- apiKeyAuth: []
```
## Authentication Instructions
Follow these steps to configure authentication for this third-party application. For additional help, see the Getting Started Example.
### Pre-Action Steps
Prior to ChatGPT authentication setup, perform these actions in the application:
- Get your API Key from the Webhook config panel
### In ChatGPT
In ChatGPT, select "Authentication" and opt for **"API Key"**. Input the details as follows:
- **API Key**: (Paste your API Key provided by the Retool Workflow Webhook Trigger)
- **Auth Type**: Custom
- **Custom Header Name**: X-Workflow-Api-Key
### FAQ & Troubleshooting
- *Auth Error:* Verify the custom header name is entered correctly.
- *Invalid Workflow Error:* Confirm your workflow is deployed in Retool.
*Are there integrations that you’d like us to prioritize? Are there errors in our integrations? File a PR or issue in our github, and we’ll take a look.*