Execute Workflows via API
meinGPT workflows can also be executed via the API and thus be integrated into existing systems.
This feature is intended for developers and advanced users. If you use the meinGPT platform, you can also create and execute workflows directly through the user interface.
The meinGPT Workflows API
The meinGPT Workflows API allows workflows to be executed programmatically. This is particularly useful when workflows need to be integrated into existing systems.
This feature is not available to all meinGPT users. If your organization wants to use the API functions, please contact meinGPT support.
Authorization
Requests to the meinGPT API must be authenticated with an API token. You can generate this in your personal settings in the meinGPT platform.
This token must be included in all requests in the 'Authorization' header as a bearer token.
Example:
Authorization: Bearer sk_meingpt_1234567890
Execute Workflows
The endpoint for executing workflows can be found under the "API" tab in the meinGPT platform when editing a workflow.
Requests must always be sent as "POST" to this endpoint.
Request Body
The content of the request body must be a JSON object containing the input parameters of the workflow:
{
"input": {
"variable-1": "Value 1",
"variable-2": "Value 2",
"toggle-value-3": true
},
"language": "de" // Optional language specification (as ISO 639-1 code)
}
Don't forget to set the corresponding Content-Type header:
Content-Type: application/json
Language Setting
Optionally, a language can be specified as an ISO 639-1 code in the "language" field (default value is "de"). This value can influence the system prompt and context that is automatically generated by meinGPT and appended to the prompt. It has the same effect as the language setting in the meinGPT platform.
Possible values are: en
, de
, es
, it
, fr
Response
Successful Execution
Status Code: 2xx
{
"status": "success",
"workflowId": "cm3g1hs780001jjv3pzrputld",
"input": {
"name": "Alice"
},
"response": [
// the workflow messages in chronological order
{
"content": "Greet Alice very warmly.",
"role": "user"
},
{
"content": "Of course! Here's a message you can send to Alice:\n\n---\n\n**Subject:** Warm Greetings\n\nDear Alice,\n\nI hope you're doing well! I wanted to send you my warmest greetings and wish you all the best.\n\nLooking forward to our next meeting!\n\nBest regards,\n[Your name]\n\n---\n\nFeel free to adjust the text according to your needs!",
"role": "assistant",
"model": "gpt-4o-mini"
}
]
}
Typescript Type Definition:
type WorkflowResponse = {
status: string;
workflowId: string;
input: Record<string, string | boolean>;
response: Array<{
content: string;
role: string;
model?: string; // Optional property for model
}>;
};
Possible Error
Status Code: 4xx, 5xx
In case of an error, no JSON object is returned, but rather an error message in text form.