Skip to content
On this page

Run Flow

The flows/run endpoint allows you to execute a flow with the specified input parameters. This endpoint takes the input parameters as a JSON object and returns the flow's output after processing the input data.

Use Cases:

  • Executing a flow to process data or automate tasks.
  • Integrating the flow's output into your application or system.
  • Triggering a flow based on specific events or conditions.

Example Request

http
POST /api/flows/run/clibnwpno000bmc0k9hvv3y7f HTTP/1.1
x-api-key: 7341ec8f-ba13-48f1-985a-db90896eff7f
Content-Type: application/json
Host: api.promptchainer.io

{
  "variables": {
    "item": "cat",
    "color": "green"
  }
}
curl
curl -X POST \
  'https://api.promptchainer.io/api/flows/run/clibnwpno000bmc0k9hvv3y7f' \
  --header 'x-api-key: 7341ec8f-ba13-48f1-985a-db90896eff7f' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "variables": {
    "item": "cat",
    "color": "green"
  }
}'
javascript
let headersList = {
  "x-api-key": "7341ec8f-ba13-48f1-985a-db90896eff7f",
  "Content-Type": "application/json"
 }
 
 let bodyContent = JSON.stringify({
   "variables": {
     "item": "cat",
     "color": "green"
   }
 });
 
 let response = await fetch("https://api.promptchainer.io/api/flows/run/clibnwpno000bmc0k9hvv3y7f", { 
   method: "POST",
   body: bodyContent,
   headers: headersList
 });
 
 let data = await response.text();
 console.log(data);
python
import http.client
import json

conn = http.client.HTTPSConnection("api.promptchainer.io")

headersList = {
 "x-api-key": "7341ec8f-ba13-48f1-985a-db90896eff7f",
 "Content-Type": "application/json" 
}

payload = json.dumps({
  "variables": {
    "item": "cat",
    "color": "green"
  }
})

conn.request("POST", "/api/flows/run/clibnwpno000bmc0k9hvv3y7f", payload, headersList)
response = conn.getresponse()
result = response.read()

print(result.decode("utf-8"))
json
{
  "nodes": [
    {
      "type": "variableNode",
      "position": {
        "x": 1268,
        "y": 633
      },
      "data": {
        "variable": {
          "label": "color",
          "value": "Blue"
        }
      },
      "connectable": true,
      "dragging": false,
      "id": "d2f04675-b516-49f0-8b37-4d323fe6737d",
      "width": 260,
      "height": 146
    },
    {
      "type": "variableNode",
      "position": {
        "x": 1269,
        "y": 824
      },
      "data": {
        "variable": {
          "label": "item",
          "value": "Ball"
        }
      },
      "connectable": true,
      "dragging": false,
      "id": "fe4ba672-1b7f-4e10-a66d-51ef38d49562",
      "width": 260,
      "height": 146,
      "selected": false,
      "positionAbsolute": {
        "x": 1269,
        "y": 824
      }
    },
    {
      "type": "imageNode",
      "position": {
        "x": 1669,
        "y": 547
      },
      "data": {
        "name": "img",
        "variables": [
          {
            "id": "d2f04675-b516-49f0-8b37-4d323fe6737d",
            "label": "color",
            "value": "Blue"
          },
          {
            "id": "fe4ba672-1b7f-4e10-a66d-51ef38d49562",
            "label": "item",
            "value": "Ball"
          }
        ],
        "modelParams": {
          "model": "dall-e"
        },
        "prompt": "A picture of a {color} and big {item}",
        "output": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-uR199VMx5csiMWN0ett3qiZC/user-HqsqjutgGORv3O8OsBOARVvy/img-jW9oxzX3pUKA3dmO7MriOiSd.png?st=2023-05-31T11%3A08%3A55Z&se=2023-05-31T13%3A08%3A55Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-05-30T20%3A17%3A57Z&ske=2023-05-31T20%3A17%3A57Z&sks=b&skv=2021-08-06&sig=LZRCEQJp3hEzEp1SXJ5bxI1JrBa6PunwJJto7xGiHbU%3D",
        "lastRundate": "2023-05-31T12:08:55.598Z"
      },
      "connectable": true,
      "dragging": false,
      "id": "e7c5aba3-3d57-4ce8-81b8-04404c6d391a",
      "width": 271,
      "height": 1019,
      "selected": false,
      "positionAbsolute": {
        "x": 1669,
        "y": 547
      }
    },
    {
      "type": "outputNode",
      "position": {
        "x": 2078,
        "y": 660
      },
      "data": {
        "name": "image",
        "output": {
          "e7c5aba3-3d57-4ce8-81b8-04404c6d391a": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-uR199VMx5csiMWN0ett3qiZC/user-HqsqjutgGORv3O8OsBOARVvy/img-jW9oxzX3pUKA3dmO7MriOiSd.png?st=2023-05-31T11%3A08%3A55Z&se=2023-05-31T13%3A08%3A55Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-05-30T20%3A17%3A57Z&ske=2023-05-31T20%3A17%3A57Z&sks=b&skv=2021-08-06&sig=LZRCEQJp3hEzEp1SXJ5bxI1JrBa6PunwJJto7xGiHbU%3D"
        }
      },
      "connectable": true,
      "dragging": false,
      "id": "068ba195-8880-4a7e-99e3-6f9331462722",
      "width": 271,
      "height": 460,
      "selected": false,
      "positionAbsolute": {
        "x": 2078,
        "y": 660
      }
    },
    {
      "type": "actionNode",
      "position": {
        "x": 2370.04377754738,
        "y": 662.4354789633089
      },
      "data": {
        "name": "joke",
        "variables": [
          {
            "id": "d2f04675-b516-49f0-8b37-4d323fe6737d",
            "label": "color",
            "value": "Blue"
          },
          {
            "id": "fe4ba672-1b7f-4e10-a66d-51ef38d49562",
            "label": "item",
            "value": "Ball"
          }
        ],
        "modelParams": {
          "model": "text-davinci-003",
          "temperature": 0.7,
          "max_tokens": 2500,
          "top_p": 1,
          "frequency_penalty": 0,
          "presence_penalty": 0,
          "n": 1,
          "best_of": 1
        },
        "prompt": "A joke about a {color} and big {item}",
        "output": ""
      },
      "connectable": true,
      "dragging": false,
      "id": "3fff0dbb-7784-41ba-889b-9988d3a3c5d2",
      "width": 218,
      "height": 342,
      "selected": false,
      "positionAbsolute": {
        "x": 2370.04377754738,
        "y": 662.4354789633089
      }
    },
    {
      "type": "outputNode",
      "position": {
        "x": 2378.784624936171,
        "y": 1013.0405797803693
      },
      "data": {
        "name": "text",
        "output": {
          "3fff0dbb-7784-41ba-889b-9988d3a3c5d2": ""
        }
      },
      "connectable": true,
      "dragging": false,
      "id": "846b3bef-15c6-434f-9a38-fa5f26bb635c",
      "width": 260,
      "height": 100,
      "selected": true,
      "positionAbsolute": {
        "x": 2378.784624936171,
        "y": 1013.0405797803693
      }
    }
  ],
  "edges": [
    {
      "source": "fe4ba672-1b7f-4e10-a66d-51ef38d49562",
      "sourceHandle": "output",
      "target": "e7c5aba3-3d57-4ce8-81b8-04404c6d391a",
      "targetHandle": "variables",
      "id": "reactflow__edge-fe4ba672-1b7f-4e10-a66d-51ef38d49562output-e7c5aba3-3d57-4ce8-81b8-04404c6d391avariables"
    },
    {
      "source": "d2f04675-b516-49f0-8b37-4d323fe6737d",
      "sourceHandle": "output",
      "target": "e7c5aba3-3d57-4ce8-81b8-04404c6d391a",
      "targetHandle": "variables",
      "id": "reactflow__edge-d2f04675-b516-49f0-8b37-4d323fe6737doutput-e7c5aba3-3d57-4ce8-81b8-04404c6d391avariables"
    },
    {
      "source": "e7c5aba3-3d57-4ce8-81b8-04404c6d391a",
      "sourceHandle": "output",
      "target": "068ba195-8880-4a7e-99e3-6f9331462722",
      "targetHandle": "input",
      "id": "reactflow__edge-e7c5aba3-3d57-4ce8-81b8-04404c6d391aoutput-068ba195-8880-4a7e-99e3-6f9331462722input"
    },
    {
      "source": "d2f04675-b516-49f0-8b37-4d323fe6737d",
      "sourceHandle": "output",
      "target": "3fff0dbb-7784-41ba-889b-9988d3a3c5d2",
      "targetHandle": "variables",
      "id": "reactflow__edge-d2f04675-b516-49f0-8b37-4d323fe6737doutput-3fff0dbb-7784-41ba-889b-9988d3a3c5d2variables"
    },
    {
      "source": "fe4ba672-1b7f-4e10-a66d-51ef38d49562",
      "sourceHandle": "output",
      "target": "3fff0dbb-7784-41ba-889b-9988d3a3c5d2",
      "targetHandle": "variables",
      "id": "reactflow__edge-fe4ba672-1b7f-4e10-a66d-51ef38d49562output-3fff0dbb-7784-41ba-889b-9988d3a3c5d2variables"
    },
    {
      "source": "3fff0dbb-7784-41ba-889b-9988d3a3c5d2",
      "sourceHandle": "output",
      "target": "846b3bef-15c6-434f-9a38-fa5f26bb635c",
      "targetHandle": "input",
      "id": "reactflow__edge-3fff0dbb-7784-41ba-889b-9988d3a3c5d2output-846b3bef-15c6-434f-9a38-fa5f26bb635cinput"
    }
  ]
}

Response

The response from the flows/run endpoint is a JSON array containing the output of the flow.

Example Response

json
[
  {
    "name": "image",
    "output": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-uR199VMx5csiMWN0ett3qiZC/user-HqsqjutgGORv3O8OsBOARVvy/img-JJQcQcpsqvZ9XGDGyaUATyZC.png?st=2023-05-31T12%3A35%3A25Z&se=2023-05-31T14%3A35%3A25Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-05-30T20%3A17%3A12Z&ske=2023-05-31T20%3A17%3A12Z&sks=b&skv=2021-08-06&sig=/7zEtZsMDucfbXLhZJg472uucvXpzcLkv89Ubu%2BCChU%3D",
    "type": "output"
  },
  {
    "name": "text",
    "output": "\n\nQ: What do you call a green and big cat?\nA: A Meanie Meaneron!",
    "type": "output"
  }
]
http
POST /api/flows/run/clibnwpno000bmc0k9hvv3y7f HTTP/1.1
x-api-key: 7341ec8f-ba13-48f1-985a-db90896eff7f
Content-Type: application/json
Host: api.promptchainer.io

{
  "variables": {
    "item": "cat",
    "color": "green"
  }
}
json
{
  "nodes": [
    {
      "type": "variableNode",
      "position": {
        "x": 1268,
        "y": 633
      },
      "data": {
        "variable": {
          "label": "color",
          "value": "Blue"
        }
      },
      "connectable": true,
      "dragging": false,
      "id": "d2f04675-b516-49f0-8b37-4d323fe6737d",
      "width": 260,
      "height": 146
    },
    {
      "type": "variableNode",
      "position": {
        "x": 1269,
        "y": 824
      },
      "data": {
        "variable": {
          "label": "item",
          "value": "Ball"
        }
      },
      "connectable": true,
      "dragging": false,
      "id": "fe4ba672-1b7f-4e10-a66d-51ef38d49562",
      "width": 260,
      "height": 146,
      "selected": false,
      "positionAbsolute": {
        "x": 1269,
        "y": 824
      }
    },
    {
      "type": "imageNode",
      "position": {
        "x": 1669,
        "y": 547
      },
      "data": {
        "name": "img",
        "variables": [
          {
            "id": "d2f04675-b516-49f0-8b37-4d323fe6737d",
            "label": "color",
            "value": "Blue"
          },
          {
            "id": "fe4ba672-1b7f-4e10-a66d-51ef38d49562",
            "label": "item",
            "value": "Ball"
          }
        ],
        "modelParams": {
          "model": "dall-e"
        },
        "prompt": "A picture of a {color} and big {item}",
        "output": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-uR199VMx5csiMWN0ett3qiZC/user-HqsqjutgGORv3O8OsBOARVvy/img-jW9oxzX3pUKA3dmO7MriOiSd.png?st=2023-05-31T11%3A08%3A55Z&se=2023-05-31T13%3A08%3A55Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-05-30T20%3A17%3A57Z&ske=2023-05-31T20%3A17%3A57Z&sks=b&skv=2021-08-06&sig=LZRCEQJp3hEzEp1SXJ5bxI1JrBa6PunwJJto7xGiHbU%3D",
        "lastRundate": "2023-05-31T12:08:55.598Z"
      },
      "connectable": true,
      "dragging": false,
      "id": "e7c5aba3-3d57-4ce8-81b8-04404c6d391a",
      "width": 271,
      "height": 1019,
      "selected": false,
      "positionAbsolute": {
        "x": 1669,
        "y": 547
      }
    },
    {
      "type": "outputNode",
      "position": {
        "x": 2078,
        "y": 660
      },
      "data": {
        "name": "image",
        "output": {
          "e7c5aba3-3d57-4ce8-81b8-04404c6d391a": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-uR199VMx5csiMWN0ett3qiZC/user-HqsqjutgGORv3O8OsBOARVvy/img-jW9oxzX3pUKA3dmO7MriOiSd.png?st=2023-05-31T11%3A08%3A55Z&se=2023-05-31T13%3A08%3A55Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-05-30T20%3A17%3A57Z&ske=2023-05-31T20%3A17%3A57Z&sks=b&skv=2021-08-06&sig=LZRCEQJp3hEzEp1SXJ5bxI1JrBa6PunwJJto7xGiHbU%3D"
        }
      },
      "connectable": true,
      "dragging": false,
      "id": "068ba195-8880-4a7e-99e3-6f9331462722",
      "width": 271,
      "height": 460,
      "selected": false,
      "positionAbsolute": {
        "x": 2078,
        "y": 660
      }
    },
    {
      "type": "actionNode",
      "position": {
        "x": 2370.04377754738,
        "y": 662.4354789633089
      },
      "data": {
        "name": "joke",
        "variables": [
          {
            "id": "d2f04675-b516-49f0-8b37-4d323fe6737d",
            "label": "color",
            "value": "Blue"
          },
          {
            "id": "fe4ba672-1b7f-4e10-a66d-51ef38d49562",
            "label": "item",
            "value": "Ball"
          }
        ],
        "modelParams": {
          "model": "text-davinci-003",
          "temperature": 0.7,
          "max_tokens": 2500,
          "top_p": 1,
          "frequency_penalty": 0,
          "presence_penalty": 0,
          "n": 1,
          "best_of": 1
        },
        "prompt": "A joke about a {color} and big {item}",
        "output": ""
      },
      "connectable": true,
      "dragging": false,
      "id": "3fff0dbb-7784-41ba-889b-9988d3a3c5d2",
      "width": 218,
      "height": 342,
      "selected": false,
      "positionAbsolute": {
        "x": 2370.04377754738,
        "y": 662.4354789633089
      }
    },
    {
      "type": "outputNode",
      "position": {
        "x": 2378.784624936171,
        "y": 1013.0405797803693
      },
      "data": {
        "name": "text",
        "output": {
          "3fff0dbb-7784-41ba-889b-9988d3a3c5d2": ""
        }
      },
      "connectable": true,
      "dragging": false,
      "id": "846b3bef-15c6-434f-9a38-fa5f26bb635c",
      "width": 260,
      "height": 100,
      "selected": true,
      "positionAbsolute": {
        "x": 2378.784624936171,
        "y": 1013.0405797803693
      }
    }
  ],
  "edges": [
    {
      "source": "fe4ba672-1b7f-4e10-a66d-51ef38d49562",
      "sourceHandle": "output",
      "target": "e7c5aba3-3d57-4ce8-81b8-04404c6d391a",
      "targetHandle": "variables",
      "id": "reactflow__edge-fe4ba672-1b7f-4e10-a66d-51ef38d49562output-e7c5aba3-3d57-4ce8-81b8-04404c6d391avariables"
    },
    {
      "source": "d2f04675-b516-49f0-8b37-4d323fe6737d",
      "sourceHandle": "output",
      "target": "e7c5aba3-3d57-4ce8-81b8-04404c6d391a",
      "targetHandle": "variables",
      "id": "reactflow__edge-d2f04675-b516-49f0-8b37-4d323fe6737doutput-e7c5aba3-3d57-4ce8-81b8-04404c6d391avariables"
    },
    {
      "source": "e7c5aba3-3d57-4ce8-81b8-04404c6d391a",
      "sourceHandle": "output",
      "target": "068ba195-8880-4a7e-99e3-6f9331462722",
      "targetHandle": "input",
      "id": "reactflow__edge-e7c5aba3-3d57-4ce8-81b8-04404c6d391aoutput-068ba195-8880-4a7e-99e3-6f9331462722input"
    },
    {
      "source": "d2f04675-b516-49f0-8b37-4d323fe6737d",
      "sourceHandle": "output",
      "target": "3fff0dbb-7784-41ba-889b-9988d3a3c5d2",
      "targetHandle": "variables",
      "id": "reactflow__edge-d2f04675-b516-49f0-8b37-4d323fe6737doutput-3fff0dbb-7784-41ba-889b-9988d3a3c5d2variables"
    },
    {
      "source": "fe4ba672-1b7f-4e10-a66d-51ef38d49562",
      "sourceHandle": "output",
      "target": "3fff0dbb-7784-41ba-889b-9988d3a3c5d2",
      "targetHandle": "variables",
      "id": "reactflow__edge-fe4ba672-1b7f-4e10-a66d-51ef38d49562output-3fff0dbb-7784-41ba-889b-9988d3a3c5d2variables"
    },
    {
      "source": "3fff0dbb-7784-41ba-889b-9988d3a3c5d2",
      "sourceHandle": "output",
      "target": "846b3bef-15c6-434f-9a38-fa5f26bb635c",
      "targetHandle": "input",
      "id": "reactflow__edge-3fff0dbb-7784-41ba-889b-9988d3a3c5d2output-846b3bef-15c6-434f-9a38-fa5f26bb635cinput"
    }
  ]
}

Arguments

NameTypeDescription
variablesobject, arrayVariables to execute the flow with

Single and multiple execution

The flows/run endpoint allows you to execute a flow with the specified input parameters. This endpoint takes the input parameters as a JSON object and returns the flow's output after processing the input data.

If the provided variables are an array, the flow will be executed multiple times, once for each element in the array. The output will be an array of the outputs of each execution.

Multiple executions

http
POST /api/flows/run/clibnwpno000bmc0k9hvv3y7f HTTP/1.1
x-api-key: 7341ec8f-ba13-48f1-985a-db90896eff7f
Content-Type: application/json
Host: api.promptchainer.io

{
  "variables": [
    {
      "item": "cat",
      "color": "green"
    },
    {
      "item": "dog",
      "color": "purple"
    }
  ]
}
curl
curl -X POST \
  'https://api.promptchainer.io/api/flows/run/clibnwpno000bmc0k9hvv3y7f' \
  --header 'x-api-key: 7341ec8f-ba13-48f1-985a-db90896eff7f' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "variables": [
    {
      "item": "cat",
      "color": "green"
    },
    {
      "item": "dog",
      "color": "purple"
    }
  ]
}'
javascript
let headersList = {
  "x-api-key": "7341ec8f-ba13-48f1-985a-db90896eff7f",
  "Content-Type": "application/json"
}

let bodyContent = JSON.stringify({
  "variables": [
    {
      "item": "cat",
      "color": "green"
    },
    {
      "item": "dog",
      "color": "purple"
    }
  ]
});

let response = await fetch("https://api.promptchainer.io/api/flows/run/clibnwpno000bmc0k9hvv3y7f", {
  method: "POST",
  body: bodyContent,
  headers: headersList
});

let data = await response.text();
console.log(data);
python
import http.client
import json

conn = http.client.HTTPSConnection("api.promptchainer.io")

headersList = {
 "x-api-key": "7341ec8f-ba13-48f1-985a-db90896eff7f",
 "Content-Type": "application/json" 
}

payload = json.dumps({
  "variables": [
    {
      "item": "cat",
      "color": "green"
    },
    {
      "item": "dog",
      "color": "purple"
    }
   ]
})

conn.request("POST", "/api/flows/run/clibnwpno000bmc0k9hvv3y7f", payload, headersList)
response = conn.getresponse()
result = response.read()

print(result.decode("utf-8"))
json
{
  "nodes": [
    {
      "type": "variableNode",
      "position": {
        "x": 1268,
        "y": 633
      },
      "data": {
        "variable": {
          "label": "color",
          "value": "Blue"
        }
      },
      "connectable": true,
      "dragging": false,
      "id": "d2f04675-b516-49f0-8b37-4d323fe6737d",
      "width": 260,
      "height": 146
    },
    {
      "type": "variableNode",
      "position": {
        "x": 1269,
        "y": 824
      },
      "data": {
        "variable": {
          "label": "item",
          "value": "Ball"
        }
      },
      "connectable": true,
      "dragging": false,
      "id": "fe4ba672-1b7f-4e10-a66d-51ef38d49562",
      "width": 260,
      "height": 146,
      "selected": false,
      "positionAbsolute": {
        "x": 1269,
        "y": 824
      }
    },
    {
      "type": "imageNode",
      "position": {
        "x": 1669,
        "y": 547
      },
      "data": {
        "name": "img",
        "variables": [
          {
            "id": "d2f04675-b516-49f0-8b37-4d323fe6737d",
            "label": "color",
            "value": "Blue"
          },
          {
            "id": "fe4ba672-1b7f-4e10-a66d-51ef38d49562",
            "label": "item",
            "value": "Ball"
          }
        ],
        "modelParams": {
          "model": "dall-e"
        },
        "prompt": "A picture of a {color} and big {item}",
        "output": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-uR199VMx5csiMWN0ett3qiZC/user-HqsqjutgGORv3O8OsBOARVvy/img-jW9oxzX3pUKA3dmO7MriOiSd.png?st=2023-05-31T11%3A08%3A55Z&se=2023-05-31T13%3A08%3A55Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-05-30T20%3A17%3A57Z&ske=2023-05-31T20%3A17%3A57Z&sks=b&skv=2021-08-06&sig=LZRCEQJp3hEzEp1SXJ5bxI1JrBa6PunwJJto7xGiHbU%3D",
        "lastRundate": "2023-05-31T12:08:55.598Z"
      },
      "connectable": true,
      "dragging": false,
      "id": "e7c5aba3-3d57-4ce8-81b8-04404c6d391a",
      "width": 271,
      "height": 1019,
      "selected": false,
      "positionAbsolute": {
        "x": 1669,
        "y": 547
      }
    },
    {
      "type": "outputNode",
      "position": {
        "x": 2078,
        "y": 660
      },
      "data": {
        "name": "image",
        "output": {
          "e7c5aba3-3d57-4ce8-81b8-04404c6d391a": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-uR199VMx5csiMWN0ett3qiZC/user-HqsqjutgGORv3O8OsBOARVvy/img-jW9oxzX3pUKA3dmO7MriOiSd.png?st=2023-05-31T11%3A08%3A55Z&se=2023-05-31T13%3A08%3A55Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-05-30T20%3A17%3A57Z&ske=2023-05-31T20%3A17%3A57Z&sks=b&skv=2021-08-06&sig=LZRCEQJp3hEzEp1SXJ5bxI1JrBa6PunwJJto7xGiHbU%3D"
        }
      },
      "connectable": true,
      "dragging": false,
      "id": "068ba195-8880-4a7e-99e3-6f9331462722",
      "width": 271,
      "height": 460,
      "selected": false,
      "positionAbsolute": {
        "x": 2078,
        "y": 660
      }
    },
    {
      "type": "actionNode",
      "position": {
        "x": 2370.04377754738,
        "y": 662.4354789633089
      },
      "data": {
        "name": "joke",
        "variables": [
          {
            "id": "d2f04675-b516-49f0-8b37-4d323fe6737d",
            "label": "color",
            "value": "Blue"
          },
          {
            "id": "fe4ba672-1b7f-4e10-a66d-51ef38d49562",
            "label": "item",
            "value": "Ball"
          }
        ],
        "modelParams": {
          "model": "text-davinci-003",
          "temperature": 0.7,
          "max_tokens": 2500,
          "top_p": 1,
          "frequency_penalty": 0,
          "presence_penalty": 0,
          "n": 1,
          "best_of": 1
        },
        "prompt": "A joke about a {color} and big {item}",
        "output": ""
      },
      "connectable": true,
      "dragging": false,
      "id": "3fff0dbb-7784-41ba-889b-9988d3a3c5d2",
      "width": 218,
      "height": 342,
      "selected": false,
      "positionAbsolute": {
        "x": 2370.04377754738,
        "y": 662.4354789633089
      }
    },
    {
      "type": "outputNode",
      "position": {
        "x": 2378.784624936171,
        "y": 1013.0405797803693
      },
      "data": {
        "name": "text",
        "output": {
          "3fff0dbb-7784-41ba-889b-9988d3a3c5d2": ""
        }
      },
      "connectable": true,
      "dragging": false,
      "id": "846b3bef-15c6-434f-9a38-fa5f26bb635c",
      "width": 260,
      "height": 100,
      "selected": true,
      "positionAbsolute": {
        "x": 2378.784624936171,
        "y": 1013.0405797803693
      }
    }
  ],
  "edges": [
    {
      "source": "fe4ba672-1b7f-4e10-a66d-51ef38d49562",
      "sourceHandle": "output",
      "target": "e7c5aba3-3d57-4ce8-81b8-04404c6d391a",
      "targetHandle": "variables",
      "id": "reactflow__edge-fe4ba672-1b7f-4e10-a66d-51ef38d49562output-e7c5aba3-3d57-4ce8-81b8-04404c6d391avariables"
    },
    {
      "source": "d2f04675-b516-49f0-8b37-4d323fe6737d",
      "sourceHandle": "output",
      "target": "e7c5aba3-3d57-4ce8-81b8-04404c6d391a",
      "targetHandle": "variables",
      "id": "reactflow__edge-d2f04675-b516-49f0-8b37-4d323fe6737doutput-e7c5aba3-3d57-4ce8-81b8-04404c6d391avariables"
    },
    {
      "source": "e7c5aba3-3d57-4ce8-81b8-04404c6d391a",
      "sourceHandle": "output",
      "target": "068ba195-8880-4a7e-99e3-6f9331462722",
      "targetHandle": "input",
      "id": "reactflow__edge-e7c5aba3-3d57-4ce8-81b8-04404c6d391aoutput-068ba195-8880-4a7e-99e3-6f9331462722input"
    },
    {
      "source": "d2f04675-b516-49f0-8b37-4d323fe6737d",
      "sourceHandle": "output",
      "target": "3fff0dbb-7784-41ba-889b-9988d3a3c5d2",
      "targetHandle": "variables",
      "id": "reactflow__edge-d2f04675-b516-49f0-8b37-4d323fe6737doutput-3fff0dbb-7784-41ba-889b-9988d3a3c5d2variables"
    },
    {
      "source": "fe4ba672-1b7f-4e10-a66d-51ef38d49562",
      "sourceHandle": "output",
      "target": "3fff0dbb-7784-41ba-889b-9988d3a3c5d2",
      "targetHandle": "variables",
      "id": "reactflow__edge-fe4ba672-1b7f-4e10-a66d-51ef38d49562output-3fff0dbb-7784-41ba-889b-9988d3a3c5d2variables"
    },
    {
      "source": "3fff0dbb-7784-41ba-889b-9988d3a3c5d2",
      "sourceHandle": "output",
      "target": "846b3bef-15c6-434f-9a38-fa5f26bb635c",
      "targetHandle": "input",
      "id": "reactflow__edge-3fff0dbb-7784-41ba-889b-9988d3a3c5d2output-846b3bef-15c6-434f-9a38-fa5f26bb635cinput"
    }
  ]
}

Example Response

json
[
  [
    {
      "name": "image",
      "output": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-uR199VMx5csiMWN0ett3qiZC/user-HqsqjutgGORv3O8OsBOARVvy/img-agsVODX61fSceklbrcEUPgdr.png?st=2023-05-31T13%3A04%3A23Z&se=2023-05-31T15%3A04%3A23Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-05-30T20%3A19%3A01Z&ske=2023-05-31T20%3A19%3A01Z&sks=b&skv=2021-08-06&sig=n2La/XtVcohzMmJqIpwqE9/mv2SY9FfLUpy9bLTRCPI%3D",
      "type": "output"
    },
    {
      "name": "text",
      "output": "\n\nQ: What do you call a green and big cat?\nA: A Meanie Meanerson!",
      "type": "output"
    }
  ],
  [
    {
      "name": "image",
      "output": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-uR199VMx5csiMWN0ett3qiZC/user-HqsqjutgGORv3O8OsBOARVvy/img-JKUNepSkxVDdAegk8648m4Bo.png?st=2023-05-31T13%3A04%3A24Z&se=2023-05-31T15%3A04%3A24Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-05-30T20%3A18%3A50Z&ske=2023-05-31T20%3A18%3A50Z&sks=b&skv=2021-08-06&sig=WfOsAfzjeKrlLikxiflgTgSHn7hA0Bq8Wrv8LwVEy0c%3D",
      "type": "output"
    },
    {
      "name": "text",
      "output": "\n\nQ: What did the purple and big dog say when it saw a cat?\nA: \"That's a BIG cat!\"",
      "type": "output"
    }
  ]
]
http
POST /api/flows/run/clibnwpno000bmc0k9hvv3y7f HTTP/1.1
x-api-key: 7341ec8f-ba13-48f1-985a-db90896eff7f
Content-Type: application/json
Host: api.promptchainer.io

{
  "variables": [
    {
      "item": "cat",
      "color": "green"
    },
    {
      "item": "dog",
      "color": "purple"
    }
  ]
}
json
{
  "nodes": [
    {
      "type": "variableNode",
      "position": {
        "x": 1268,
        "y": 633
      },
      "data": {
        "variable": {
          "label": "color",
          "value": "Blue"
        }
      },
      "connectable": true,
      "dragging": false,
      "id": "d2f04675-b516-49f0-8b37-4d323fe6737d",
      "width": 260,
      "height": 146
    },
    {
      "type": "variableNode",
      "position": {
        "x": 1269,
        "y": 824
      },
      "data": {
        "variable": {
          "label": "item",
          "value": "Ball"
        }
      },
      "connectable": true,
      "dragging": false,
      "id": "fe4ba672-1b7f-4e10-a66d-51ef38d49562",
      "width": 260,
      "height": 146,
      "selected": false,
      "positionAbsolute": {
        "x": 1269,
        "y": 824
      }
    },
    {
      "type": "imageNode",
      "position": {
        "x": 1669,
        "y": 547
      },
      "data": {
        "name": "img",
        "variables": [
          {
            "id": "d2f04675-b516-49f0-8b37-4d323fe6737d",
            "label": "color",
            "value": "Blue"
          },
          {
            "id": "fe4ba672-1b7f-4e10-a66d-51ef38d49562",
            "label": "item",
            "value": "Ball"
          }
        ],
        "modelParams": {
          "model": "dall-e"
        },
        "prompt": "A picture of a {color} and big {item}",
        "output": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-uR199VMx5csiMWN0ett3qiZC/user-HqsqjutgGORv3O8OsBOARVvy/img-jW9oxzX3pUKA3dmO7MriOiSd.png?st=2023-05-31T11%3A08%3A55Z&se=2023-05-31T13%3A08%3A55Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-05-30T20%3A17%3A57Z&ske=2023-05-31T20%3A17%3A57Z&sks=b&skv=2021-08-06&sig=LZRCEQJp3hEzEp1SXJ5bxI1JrBa6PunwJJto7xGiHbU%3D",
        "lastRundate": "2023-05-31T12:08:55.598Z"
      },
      "connectable": true,
      "dragging": false,
      "id": "e7c5aba3-3d57-4ce8-81b8-04404c6d391a",
      "width": 271,
      "height": 1019,
      "selected": false,
      "positionAbsolute": {
        "x": 1669,
        "y": 547
      }
    },
    {
      "type": "outputNode",
      "position": {
        "x": 2078,
        "y": 660
      },
      "data": {
        "name": "image",
        "output": {
          "e7c5aba3-3d57-4ce8-81b8-04404c6d391a": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-uR199VMx5csiMWN0ett3qiZC/user-HqsqjutgGORv3O8OsBOARVvy/img-jW9oxzX3pUKA3dmO7MriOiSd.png?st=2023-05-31T11%3A08%3A55Z&se=2023-05-31T13%3A08%3A55Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-05-30T20%3A17%3A57Z&ske=2023-05-31T20%3A17%3A57Z&sks=b&skv=2021-08-06&sig=LZRCEQJp3hEzEp1SXJ5bxI1JrBa6PunwJJto7xGiHbU%3D"
        }
      },
      "connectable": true,
      "dragging": false,
      "id": "068ba195-8880-4a7e-99e3-6f9331462722",
      "width": 271,
      "height": 460,
      "selected": false,
      "positionAbsolute": {
        "x": 2078,
        "y": 660
      }
    },
    {
      "type": "actionNode",
      "position": {
        "x": 2370.04377754738,
        "y": 662.4354789633089
      },
      "data": {
        "name": "joke",
        "variables": [
          {
            "id": "d2f04675-b516-49f0-8b37-4d323fe6737d",
            "label": "color",
            "value": "Blue"
          },
          {
            "id": "fe4ba672-1b7f-4e10-a66d-51ef38d49562",
            "label": "item",
            "value": "Ball"
          }
        ],
        "modelParams": {
          "model": "text-davinci-003",
          "temperature": 0.7,
          "max_tokens": 2500,
          "top_p": 1,
          "frequency_penalty": 0,
          "presence_penalty": 0,
          "n": 1,
          "best_of": 1
        },
        "prompt": "A joke about a {color} and big {item}",
        "output": ""
      },
      "connectable": true,
      "dragging": false,
      "id": "3fff0dbb-7784-41ba-889b-9988d3a3c5d2",
      "width": 218,
      "height": 342,
      "selected": false,
      "positionAbsolute": {
        "x": 2370.04377754738,
        "y": 662.4354789633089
      }
    },
    {
      "type": "outputNode",
      "position": {
        "x": 2378.784624936171,
        "y": 1013.0405797803693
      },
      "data": {
        "name": "text",
        "output": {
          "3fff0dbb-7784-41ba-889b-9988d3a3c5d2": ""
        }
      },
      "connectable": true,
      "dragging": false,
      "id": "846b3bef-15c6-434f-9a38-fa5f26bb635c",
      "width": 260,
      "height": 100,
      "selected": true,
      "positionAbsolute": {
        "x": 2378.784624936171,
        "y": 1013.0405797803693
      }
    }
  ],
  "edges": [
    {
      "source": "fe4ba672-1b7f-4e10-a66d-51ef38d49562",
      "sourceHandle": "output",
      "target": "e7c5aba3-3d57-4ce8-81b8-04404c6d391a",
      "targetHandle": "variables",
      "id": "reactflow__edge-fe4ba672-1b7f-4e10-a66d-51ef38d49562output-e7c5aba3-3d57-4ce8-81b8-04404c6d391avariables"
    },
    {
      "source": "d2f04675-b516-49f0-8b37-4d323fe6737d",
      "sourceHandle": "output",
      "target": "e7c5aba3-3d57-4ce8-81b8-04404c6d391a",
      "targetHandle": "variables",
      "id": "reactflow__edge-d2f04675-b516-49f0-8b37-4d323fe6737doutput-e7c5aba3-3d57-4ce8-81b8-04404c6d391avariables"
    },
    {
      "source": "e7c5aba3-3d57-4ce8-81b8-04404c6d391a",
      "sourceHandle": "output",
      "target": "068ba195-8880-4a7e-99e3-6f9331462722",
      "targetHandle": "input",
      "id": "reactflow__edge-e7c5aba3-3d57-4ce8-81b8-04404c6d391aoutput-068ba195-8880-4a7e-99e3-6f9331462722input"
    },
    {
      "source": "d2f04675-b516-49f0-8b37-4d323fe6737d",
      "sourceHandle": "output",
      "target": "3fff0dbb-7784-41ba-889b-9988d3a3c5d2",
      "targetHandle": "variables",
      "id": "reactflow__edge-d2f04675-b516-49f0-8b37-4d323fe6737doutput-3fff0dbb-7784-41ba-889b-9988d3a3c5d2variables"
    },
    {
      "source": "fe4ba672-1b7f-4e10-a66d-51ef38d49562",
      "sourceHandle": "output",
      "target": "3fff0dbb-7784-41ba-889b-9988d3a3c5d2",
      "targetHandle": "variables",
      "id": "reactflow__edge-fe4ba672-1b7f-4e10-a66d-51ef38d49562output-3fff0dbb-7784-41ba-889b-9988d3a3c5d2variables"
    },
    {
      "source": "3fff0dbb-7784-41ba-889b-9988d3a3c5d2",
      "sourceHandle": "output",
      "target": "846b3bef-15c6-434f-9a38-fa5f26bb635c",
      "targetHandle": "input",
      "id": "reactflow__edge-3fff0dbb-7784-41ba-889b-9988d3a3c5d2output-846b3bef-15c6-434f-9a38-fa5f26bb635cinput"
    }
  ]
}