Skip to content

Quickstart

This guide walks you through creating your first workflow and executing it as a job using the JustWorkflowIt API.

  • A JustWorkflowIt account (sign up)
  • An API auth token (create one in the dashboard under Settings > API Tokens)
  1. Create an organization (if you don’t have one yet)

    Terminal window
    curl -X POST https://api.justworkflowit.com/organizations \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"name": "My Org", "displayName": "My Organization"}'

    Save the returned organizationId.

  2. Register a workflow

    Terminal window
    curl -X POST https://api.justworkflowit.com/organizations/$ORG_ID/workflows \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"name": "hello-world"}'

    Save the returned workflowId.

  3. Register a workflow version with a step definition

    Terminal window
    curl -X POST https://api.justworkflowit.com/organizations/$ORG_ID/workflows/$WORKFLOW_ID/versions \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
    "definition": "{\"workflowName\":\"hello-world\",\"steps\":[{\"name\":\"greet\",\"integrationDetails\":{\"type\":\"/justworkflowit/noop\",\"inputDefinition\":{\"$ref\":\"#/definitions/workflowInput\"},\"outputDefinition\":{\"$ref\":\"#/definitions/workflowInput\"}},\"transitionToStep\":null}],\"definitions\":{\"workflowInput\":{\"type\":\"object\",\"properties\":{\"message\":{\"type\":\"string\"}},\"required\":[\"message\"],\"additionalProperties\":false}}}"
    }'

    Save the returned versionId.

  4. Tag the version as $LIVE

    Terminal window
    curl -X PUT https://api.justworkflowit.com/organizations/$ORG_ID/workflows/$WORKFLOW_ID/tags/\$LIVE \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d "{\"versionId\": \"$VERSION_ID\"}"
  5. Submit a job

    Terminal window
    curl -X POST https://api.justworkflowit.com/organizations/$ORG_ID/jobs \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d "{
    \"workflowId\": \"$WORKFLOW_ID\",
    \"workflowVersion\": {\"tag\": \"\$LIVE\"},
    \"inputJson\": {\"message\": \"Hello, World!\"}
    }"
  6. Poll for completion

    Terminal window
    curl https://api.justworkflowit.com/organizations/$ORG_ID/jobs/$JOB_ID \
    -H "Authorization: Bearer $TOKEN"

    The job will transition: PENDING -> RUNNING -> SUCCEEDED.