How to get workflow definition from Retool API

Hello,

When I open a workflow in the browser, the network inspector shows the API returning fields like blockData and templateData, which describe the workflow's structure.

However, these fields do not appear in the Get a workflow API documentation.

Example snippet from what I see in the browser:

{
    "workflow": {
        "id": "48ee968c-19c5-4fb5-bf2a-5a7c608ca652",
        "saveId": "c9ef1594-f06d-4ee3-8e47-d24f2786b4fd",
        "name": "My First Workflow -  Alon Dankner - 2025-05-29 3:48:02 PM",
        "apiKey": "retool_wk_*****",
        "description": null,
        "organizationId": 1012398,
        "isEnabled": false,
        "crontab": null,
        "timezone": "Asia/Jerusalem",
        "blockData": [
            {
                "top": 48,
                "left": 48,
                "uuid": "7f8609b2-57d4-431f-87ff-5ccecb9af7f5",
                "options": {},
                "pluginId": "startTrigger",
                "blockType": "webhook",
                "editorType": "JavascriptQuery",
                "environment": "production",
                "isMinimized": false,
                "resourceName": "webhook",
                "incomingOnSuccessEdges": []
            },
            {
                "top": 48,
                "left": 480,
                "uuid": "4bcaad6b-d162-4ece-b2d2-8a88ef470660",
                "pluginId": "code1",
                "blockType": "code",
                "dimensions": {
                    "width": 400,
                    "height": 280
                },
                "editorType": "JavascriptQuery",
                "environment": "production",
                "resourceName": "JavascriptQuery",
                "incomingOnSuccessEdges": [
                    "7f8609b2-57d4-431f-87ff-5ccecb9af7f5"
                ]
            },
            {
                "top": 48,
                "left": 1072,
                "uuid": "ea214114-15b5-4ffa-9bfd-d2c0e541aa27",
                "pluginId": "query1",
                "blockType": "default",
                "editorType": "SMTPQuery",
                "environment": "production",
                "resourceName": "retool_email",
                "incomingOnSuccessEdges": [
                    "4bcaad6b-d162-4ece-b2d2-8a88ef470660"
                ]
            }
        ],
        "templateData": "[\"~#iR\",[\"^ \",\"n\",\"appTemplate

Example snippet from what I get from the Get a workflow API call:

{
    "success": true,
    "data": {
        "id": "48ee968c-19c5-4fb5-bf2a-5a7c608ca652",
        "name": "My First Workflow -  Alon Dankner - 2025-05-29 3:48:02 PM",
        "description": null,
        "crontab": null,
        "timezone": "Asia/Jerusalem",
        "is_enabled": true,
        "folder_id": "workflow_6392627",
        "protected": false,
        "created_by": 1711269,
        "created_at": "2025-05-29T12:48:02.479Z",
        "updated_at": "2025-05-29T13:17:58.947Z"
    }
}

Is there an API to get the complete workflow definition, including blockData and templateData? If so, what endpoint or parameters should be used?

Hi @ad1,

As far as I am aware from the Retool API schema, those two properties are not included in the API response payload, so I am very curious what endpoint you are seeing this data being returned from in the browser.

Can you share more details and a screenshot of the network request for where you are seeing this in the browser?

In the networking tab it should display the endpoint that the request is being made to which is returning the Workflow object with blockData and templateData included.

And thus you would just need to make an analogous request to that same endpoints :thinking:

It also looks like we have a feature request for this endpoint in our internal ticketing system as well.

Which would likely add this full data payload to the existing endpoint as linked in the docs.

I can add a +1 to this ticket for you as well. If you have details on the use case and why these two extra fields are needed that can help our engineers understand the importance and if there are other data fields to show as well!

Unfortunately, Retool doesn’t currently provide a public API endpoint to fetch the full workflow definition (the block structure, logic, and configuration) programmatically.

At this time, the Retool API mainly supports:

  • Triggering a workflow via REST (POST /v1/workflows/<workflow-id>/startTrigger)

  • Passing input parameters and receiving execution results

  • Managing other Retool objects (apps, users, resources, etc.)

There’s no official “GET /workflows/:id/definition” endpoint documented for extracting a workflow’s configuration JSON.

Possible Workarounds:

  1. Manual Export:
    Inside the Retool Workflows editor, you can open your workflow and export or duplicate it to view its JSON structure (if available based on your plan).

  2. Self-Hosted Retool:
    If you’re on a self-hosted instance, workflow definitions are stored in the internal Retool database you can query those tables to extract definitions directly.

  3. Feature Request / Support Ticket:
    On Retool Cloud or Business plans, you can contact support to request API access for workflow metadata. Some enterprise users have access to extended API capabilities.

So in short you can trigger a workflow from the API, but you can’t fetch its internal definition via the API (as of now).