Appearance
Get Flow Info
The flows/get-flow-info
endpoint is used to retrieve information about the various required fields for running a flow. This information includes input parameters, output parameters, and other metadata related to the flow.
Use Cases:
- Querying the required input parameters for a flow.
- Retrieving information about the expected output parameters.
- Understanding the flow's structure and metadata.
Example Request
http
GET /api/flows/getFlowInfo/clibnwpno000bmc0k9hvv3y7f HTTP/1.1
x-api-key: 7341ec8f-ba13-48f1-985a-db90896eff7f
Host: api.promptchainer.io
curl
curl -X GET \
'https://api.promptchainer.io/api/flows/getFlowInfo/clibnwpno000bmc0k9hvv3y7f' \
--header 'x-api-key: 7341ec8f-ba13-48f1-985a-db90896eff7f'
javascript
let response = await fetch("https://api.promptchainer.io/api/flows/getFlowInfo/clibnwpno000bmc0k9hvv3y7f", {
method: "GET",
headers: {
"x-api-key": "7341ec8f-ba13-48f1-985a-db90896eff7f"
}
});
let data = await response.text();
console.log(data);
python
import http.client
conn = http.client.HTTPSConnection("api.promptchainer.io")
headersList = {
"Accept": "*/*",
"User-Agent": "Thunder Client (https://www.thunderclient.com)",
"x-api-key": "7341ec8f-ba13-48f1-985a-db90896eff7f"
}
payload = ""
conn.request("GET", "/api/flows/getFlowInfo/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": "gpt-3.5-turbo",
"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/getFlowInfo
endpoint is a JSON array containing information about the flow.
Each item in the array will contain the following fields:
Name | Type | Description |
---|---|---|
name | string | The name of the input variable or output value |
type | string | variable or output |
If the item is a variable, it will be required to be provided as part of the request to the flows/run
endpoint.
Example Response
json
[
{
"name": "color",
"type": "variable"
},
{
"name": "item",
"type": "variable"
},
{
"name": "image",
"type": "output"
},
{
"name": "text",
"type": "output"
}
]
http
GET /api/flows/getFlowInfo/clibnwpno000bmc0k9hvv3y7f HTTP/1.1
x-api-key: 7341ec8f-ba13-48f1-985a-db90896eff7f
Host: api.promptchainer.io
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": "gpt-3.5-turbo",
"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"
}
]
}
This description clarifies that variable items are required fields in a request to the flows/run endpoint, while output items are included in the response from the flows/run endpoint.