POST /projects/{projectId}/workflows

Dispatch workflow with given definition

Path parameters

  • projectId string Required

    Project ID

application/json

Body Required

  • definition string Required

    YAML-encoded definition

  • assets object

    Input asset or parameter assignments. Assignments should be in the form job.input, with a . dot separating the job name and asset/parameter name.

  • parameters object

    Input asset or parameter assignments. Assignments should be in the form job.input, with a . dot separating the job name and asset/parameter name.

Responses

  • 202 application/json

    Accepted

    Hide response attributes Show response attributes object
    • id string Required
    • jobs array[string] Required

      Job IDs

    • state string Required

      Current workflow state

      Values are pending, started, success, failure, or canceled.

    • created string Required

      ISO 8601 datetime

    • started string Required

      ISO 8601 datetime

    • finished string Required

      ISO 8601 datetime

    • definition string Required

      Raw definition string

    • project_id string Required

      Project ID

  • 400 application/json

    Bad Request

    Hide response attributes Show response attributes object
    • code integer

      HTTP response code

    • name string

      Status text corresponding to the HTTP response code

    • description string

      Detailed error message

  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
    • code integer

      HTTP response code

    • name string

      Status text corresponding to the HTTP response code

    • description string

      Detailed error message

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"
}