Templates /
Run template
Required permission
Account > Templates > General > Run
Path parameters
templateId
string requiredID of the template
Request body
- {object}
arguments
{object}A set of arguments that can be referenced in a template using '${args.argumentName}'.
Response body
- {object}
Response object.
data
{object} requiredResult data.
name
string requiredName of the template.
min length3max length39pattern^[a-zA-Z]((-|\s)?[a-zA-Z0-9]+((-|\s)[a-zA-Z0-9]+)*)?$description
stringDescription of the template.
max length200pattern^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$apiVersion
string requiredThe version of the Northflank API to run the template against.
one ofv1project
(multiple options: oneOf) requiredDetails of the project the template will run in.
- {object}
Use an existing project
id
string requiredThe ID of the project to use.
pattern^[A-Za-z0-9-]+$- {object}
Create a new project
spec
(multiple options: oneOf) requiredarguments
{object}A set of arguments that can be referenced in a template using '${args.argumentName}'.
spec
(multiple options: oneOf) requiredA node representing an action to be performed as part of the template.
refs
{object}id
string requiredIdentifier for the template run
templateId
string requiredIdentifier for the template
status
string requiredStatus of the template run
one ofpending, running, success, failure, aborted, abortingconcluded
boolean requiredWhether the run has concluded (aborted, success, failed)
createdAt
string requiredTimestamp the run was created at.
updatedAt
string requiredTimestamp the run was last updated at.
OR
POST /v1/templates/{templateId}/runs
Example request
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data '{"arguments":{"ARGUMENT_1":"value_1","ARGUMENT_2":"value_2"}}' \
https://api.northflank.com/v1/templates/{templateId}/runs
Example response
200 OK
JSON
{
"data": {
"name": "Example Template",
"description": "This is a sample template.",
"apiVersion": "v1",
"arguments": {
"ARGUMENT_1": "value_1",
"ARGUMENT_2": "value_2"
},
"spec": {
"settings": {
"maxAttempts": 3,
"backoff": {
"type": "fixed",
"delay": 60
}
},
"kind": "Workflow",
"response": {
"status": "success",
"retries": {
"attempts": 1,
"maxAttempts": 3,
"timestamp": 1657296265
}
}
},
"id": "3dd592f6-ce63-45ee-acf8-13dc5ec5235c",
"templateId": "example-template",
"status": "success",
"concluded": true,
"createdAt": "2021-01-01 12:00:00.000Z",
"updatedAt": "2021-01-01 12:00:00.000Z"
}
}