Dispatch workflow with given definition
Body
Required
-
YAML-encoded definition
-
Input asset or parameter assignments. Assignments should be in the form
job.input, with a.dot separating the job name and asset/parameter name. -
Input asset or parameter assignments. Assignments should be in the form
job.input, with a.dot separating the job name and asset/parameter name.
POST
/projects/{projectId}/workflows
curl \
--request POST 'https://api.metafold3d.com/projects/{projectId}/workflows' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"assets":{"preprocess-mesh.mesh":"part.stl"},"definition":"---\njobs:\n preprocess-mesh:\n type: mesh/preprocess\n compute-bvh:\n type: mesh/compute-bvh\n needs:\n - preprocess-mesh\n assets:\n mesh: preprocess-mesh\n sample-mesh:\n type: implicit/from-mesh\n needs:\n - preprocess-mesh\n - compute-bvh\n assets:\n mesh: preprocess-mesh\n bvh: compute-bvh\n...\n","parameters":{"sample-mesh.resolution":"256"}}'
Request example
{
"assets": {
"preprocess-mesh.mesh": "part.stl"
},
"definition": "---\njobs:\n preprocess-mesh:\n type: mesh/preprocess\n compute-bvh:\n type: mesh/compute-bvh\n needs:\n - preprocess-mesh\n assets:\n mesh: preprocess-mesh\n sample-mesh:\n type: implicit/from-mesh\n needs:\n - preprocess-mesh\n - compute-bvh\n assets:\n mesh: preprocess-mesh\n bvh: compute-bvh\n...\n",
"parameters": {
"sample-mesh.resolution": "256"
}
}
Response examples (202)
{
"id": "123",
"jobs": [
"1",
"2",
"3"
],
"state": "success",
"created": "2006-01-02T22:04:05+00:00",
"started": "2006-01-02T22:04:10+00:00",
"finished": "2006-01-02T22:04:40+00:00",
"definition": "---\njobs:\n preprocess-mesh:\n type: mesh/preprocess\n compute-bvh:\n type: mesh/compute-bvh\n needs:\n - preprocess-mesh\n assets:\n mesh: preprocess-mesh\n sample-mesh:\n type: implicit/from-mesh\n needs:\n - preprocess-mesh\n - compute-bvh\n assets:\n mesh: preprocess-mesh\n bvh: compute-bvh\n...\n",
"project_id": "123"
}
Response examples (400)
{
"code": 400,
"name": "Bad Request",
"description": "Expected parameter \"foo\""
}
Response examples (401)
{
"code": 401,
"name": "Unauthorzed",
"description": "Token has expired"
}