|
| 1 | +# GPT Action Library: Retool Workflow |
| 2 | + |
| 3 | +## Introduction |
| 4 | + |
| 5 | +This page provides an instruction & guide for developers building a GPT Action for a specific application. Before you proceed, make sure to first familiarize yourself with the following information: |
| 6 | +- [Introduction to GPT Actions](https://platform.openai.com/docs/actions) |
| 7 | +- [Introduction to GPT Actions Library](https://platform.openai.com/docs/actions/actions-library) |
| 8 | +- [Example of Building a GPT Action from Scratch](https://platform.openai.com/docs/actions/getting-started) |
| 9 | + |
| 10 | +This particular GPT Action provides an overview of how to connect to a **Retool Workflow**. This Action takes a users input and sends it to the workflow in Retool using a webhook trigger. Retool then performns the configured workflow and sends a response back to ChatGPT as a JSON object. |
| 11 | + |
| 12 | +### Value + Example Business Use Cases |
| 13 | + |
| 14 | +**Value**: Users can now leverage ChatGPT's natural language capability to connect directly to any workflow in Retool. |
| 15 | + |
| 16 | +**Example Use Cases**: |
| 17 | +- You have custom code running in a Retool workflow that you'd like to incorporate into a GPT. |
| 18 | +- Data Scientists maintain an external VectorDB (either using Retool Vector or another vector DB) and would like to send the results of the vector search back to ChatGPT. |
| 19 | +- Retool is used as middleware to connect to internal services, and you'd like to use Retool's webhooks to provide access to these services to ChatGPT. |
| 20 | + |
| 21 | +## Application Information |
| 22 | + |
| 23 | +### Application Key Links |
| 24 | + |
| 25 | +Check out these links from the application before you get started: |
| 26 | +- Application Website: https://retool.com/products/workflows |
| 27 | +- Application API Documentation: https://docs.retool.com/workflows |
| 28 | + |
| 29 | +### Application Prerequisites |
| 30 | + |
| 31 | +Before you get started, make sure you go through the following steps in your Retool environment: |
| 32 | +- Set up a Retool account |
| 33 | +- Create a simple workflow |
| 34 | + |
| 35 | +### Application Workflow Steps |
| 36 | + |
| 37 | +Below is an example of a basic Retool Workflow. This workflow takes in 2 values and adds them and responds to the webhook trigger with the result. |
| 38 | + |
| 39 | +***Note:*** Your workflow must be deployed before it will be accessible from your GPT. |
| 40 | + |
| 41 | +[](https://app.arcade.software/share/MG7PcF8fh3RH722eonUb) |
| 42 | + |
| 43 | + |
| 44 | +## ChatGPT Steps |
| 45 | + |
| 46 | +### Custom GPT Instructions |
| 47 | + |
| 48 | +Once you've created a Custom GPT, you should add Instructions to the GPT providing context about the GPTs role, and the actions it is able to perform. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail. |
| 49 | + |
| 50 | +### OpenAPI Schema |
| 51 | + |
| 52 | +Once you've created a Custom GPT, copy the text below in the Actions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail. |
| 53 | + |
| 54 | +***Note:*** You need to replace the __<WORKFLOW_ID>__ value in the OpenAPI spec below with the ID for your workflow. |
| 55 | + |
| 56 | + |
| 57 | +```yaml |
| 58 | +openapi: 3.1.0 |
| 59 | +info: |
| 60 | + title: Retool Workflow API |
| 61 | + description: API for interacting with Retool workflows. |
| 62 | + version: 1.0.0 |
| 63 | +servers: |
| 64 | + - url: https://api.retool.com/v1 |
| 65 | + description: Main (production) server |
| 66 | +paths: |
| 67 | + /workflows/<WORKFLOW_ID>/startTrigger: |
| 68 | + post: |
| 69 | + operationId: add_numbers |
| 70 | + summary: Takes 2 numbers and adds them. |
| 71 | + description: Initiates a workflow in Retool by triggering a specific workflow ID. |
| 72 | + requestBody: |
| 73 | + required: true |
| 74 | + content: |
| 75 | + application/json: |
| 76 | + schema: |
| 77 | + type: object |
| 78 | + properties: |
| 79 | + first: |
| 80 | + type: integer |
| 81 | + description: First parameter for the workflow. |
| 82 | + second: |
| 83 | + type: integer |
| 84 | + description: Second parameter for the workflow. |
| 85 | + responses: |
| 86 | + "200": |
| 87 | + description: Workflow triggered successfully. |
| 88 | + "400": |
| 89 | + description: Bad Request - Invalid parameters or missing data. |
| 90 | + "401": |
| 91 | + description: Unauthorized - Invalid or missing API key. |
| 92 | + security: |
| 93 | + - apiKeyAuth: [] |
| 94 | +``` |
| 95 | +
|
| 96 | +## Authentication Instructions |
| 97 | +
|
| 98 | +Below are instructions on setting up authentication with this 3rd party application. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail. |
| 99 | +
|
| 100 | +### Pre-Action Steps |
| 101 | +
|
| 102 | +Before you set up authentication in ChatGPT, please take the following steps in the application. |
| 103 | +- Get your API Key from the Webhook config panel |
| 104 | +
|
| 105 | + |
| 106 | +
|
| 107 | +### In ChatGPT |
| 108 | +
|
| 109 | +In ChatGPT, click on "Authentication" and choose **"API Key"**. Enter in the information below. |
| 110 | +
|
| 111 | +- **API Key**: (Paste your API Key provided by the Retool Workflow Webhook Trigger) |
| 112 | +- **Auth Type**: Custom |
| 113 | +- **Custom Header Name**: X-Workflow-Api-Key |
| 114 | +
|
| 115 | +### FAQ & Troubleshooting |
| 116 | +
|
| 117 | +- *Auth Error:* Ensure you have set the custom header name correctly. |
| 118 | +- *Invalid Workflow Error:* Ensure you have deployed your workflow within Retool. |
| 119 | +
|
| 120 | +*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.* |
0 commit comments