{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "jobsDocument", "type": "object", "title": "Jobs Document Schema", "required": [ "_id", "name", "tasks", "transitions", "font_size", "created", "created_by", "last_updated", "last_updated_by", "groups", "type", "variables", "watchers", "metrics", "status" ], "definitions": { "transition": { "type": "object", "title": "Transition target", "required": [ "type", "state" ], "properties": { "type": { "type": "string", "title": "Transition type", "enum": [ "standard", "revert" ] }, "state": { "type": "string", "title": "Transition state", "description": "The task finish state corresponding to this transition", "enum": [ "success", "failure", "error", "loop" ] } } }, "jobDefaultTasks": { "type": "object", "title": "The Job tasks", "description": "The tasks associated with this Job", "required": [ "workflow_start", "workflow_end" ], "properties": { "workflow_start": { "$ref": "#/definitions/workflowStartTask" }, "workflow_end": { "$ref": "#/definitions/workflowEndTask" }, "error_handler": { "$ref": "#/definitions/errorHandlerTask" } }, "patternProperties": { "[0-9a-f]{1,4}": { "$ref": "jobTaskDocument" } } }, "status": { "type": "string", "title": "The Status", "description": "The status of this job", "enum": [ "error", "complete", "running", "canceled" ], "examples": [ "error", "complete", "running", "canceled" ] }, "jobsAlphaOmegaTask": { "type": "object", "title": "base for workflow_start and workflow_end", "properties": { "groups": { "type": "array", "title": "User groups", "items": { "type": "string" } }, "nodeLocation": { "$ref": "wfEngineCommon#/definitions/nodeLocation" }, "status": { "type": "string", "title": "The Status", "examples": [ "complete" ] }, "metrics": { "$ref": "metricsDefault" } } }, "workflowStartTask": { "allOf": [ { "type": "object", "properties": { "name": { "type": "string", "enum": [ "workflow_start" ] } } }, { "$ref": "#/definitions/jobsAlphaOmegaTask" } ] }, "workflowEndTask": { "allOf": [ { "type": "object", "properties": { "name": { "type": "string", "enum": [ "workflow_end" ] } } }, { "$ref": "#/definitions/jobsAlphaOmegaTask" } ] }, "errorHandlerTask": { "allOf": [ { "$ref": "workflowDocument#/definitions/operationTask" }, { "properties": { "name": { "const": "childJob" } } } ] }, "jobStatuses": { "type": "string", "enum": [ "error", "complete", "running", "canceled" ], "examples": [ "error", "complete", "running", "canceled" ] }, "jobTaskFinishState": { "type": "string", "description": "Valid finish states for a job's tasks", "enum": [ "success", "failure", "error", "loop" ], "examples": [ "success", "failure", "error", "loop" ] }, "jobError": { "type": "object", "title": "Job Error ", "description": "A Job Error", "required": [ "task", "message", "timestamp" ], "properties": { "task": { "type": "string", "title": "The task type", "description": "The task type, usually 'job'", "examples": [ "job" ] }, "message": { "type": "string", "title": "The Error Message", "description": "Error message", "examples": [ "No available transitions found from completed task(s)" ] }, "timestamp": { "type": "integer", "title": "The Timestamp ", "description": "the time, in milliseconds since the Unix epoch, that the error occurred", "examples": [ 1555471643117 ] } } }, "variables": { "type": "object", "title": "The Variables for this job", "description": "Any variables that are set for this job", "additionalProperties": { "oneOf": [ { "type": "boolean" }, { "type": "object" }, { "type": "string" }, { "type": "number" } ], "examples": [ "string value", 1 ] } }, "staticPointer": { "type": "object", "properties": { "type": { "const": "static" }, "pointer": { "type": "string", "examples": [ "/variables/incoming/var1" ] }, "reference": { "type": "object", "properties": { "collection": { "type": "string", "enum": [ "job_data", "gridfs" ] }, "_id": { "$ref": "wfEngineCommon#/definitions/mongoObjectId" } } }, "value": { "type": "string", "description": "encoded value for the static reference" } } }, "jobVarPointer": { "type": "object", "properties": { "type": { "const": "jobVar" }, "pointer": { "type": "string", "examples": [ "/variables/incoming/var1" ] }, "variableName": { "type": "string", "description": "the name of the job variable" } } }, "taskRefPointer": { "type": "object", "properties": { "type": { "const": "taskRef" }, "pointer": { "type": "string", "examples": [ "/variables/incoming/var1" ] }, "taskId": { "type": "string", "examples": [ "abcd" ] }, "taskPointer": { "type": "string", "description": "the pointer to the value within the reference task", "examples": [ "/outgoing/output1" ] } } }, "templatePointer": { "type": "object", "properties": { "type": { "const": "template" }, "pointer": { "type": "string", "examples": [ "/variables/incoming/var1" ] }, "values": { "type": "array", "items": { "type": [ "null", "string" ] } }, "refs": { "type": "array", "items": { "oneOf": [ { "allOf": [ { "$ref": "#/definitions/jobVarPointer" }, { "type": "object", "properties": { "index": { "type": "integer" } } } ] }, { "allOf": [ { "$ref": "#/definitions/taskRefPointer" }, { "type": "object", "properties": { "index": { "type": "integer" } } } ] } ] } } } }, "taskOutgoingPointer": { "type": "object", "properties": { "type": { "const": "taskOutgoing" }, "pointer": { "type": "string", "examples": [ "/outgoing/output1", "/error" ] }, "status": { "type": "string", "enum": [ "success", "error" ] }, "taskVariableName": { "type": [ "string", "null" ], "description": "the name of the outgoing variable, if it exists", "examples": [ "result" ] } } }, "jobVarOutgoingPointer": { "type": "object", "properties": { "type": { "const": "jobVar" }, "pointer": { "type": "string", "examples": [ "/outgoing/output1", "/error" ] }, "status": { "type": "string", "enum": [ "success", "error" ] }, "variableName": { "type": "string", "description": "the name of the job variable", "examples": [ "varName" ] } } } }, "properties": { "_id": { "$ref": "wfEngineCommon#/definitions/mongoObjectId" }, "name": { "type": "string", "title": "The name of the job", "description": "The name of the job", "examples": [ "8917Test2" ] }, "tasks": { "$ref": "#/definitions/jobDefaultTasks" }, "transitions": { "type": "object", "title": "The Transitions", "description": "Describes the transitions between the different tasks", "required": [ "workflow_start", "workflow_end" ], "properties": { "workflow_start": { "type": "object", "title": "workflow_start transitions", "required": [], "patternProperties": { ".*": { "$ref": "#/definitions/transition" } } }, "workflow_end": { "type": "object", "title": "workflow_end transitions", "required": [] }, "error_handler": { "type": "object", "title": "error_handler transitions", "required": [], "patternProperties": { ".*": { "$ref": "#/definitions/transition" } } } }, "patternProperties": { "[0-9a-f]{1,4}": { "type": "object", "title": "Standard task transitions", "required": [], "patternProperties": { ".*": { "$ref": "#/definitions/transition" } } } } }, "font_size": { "type": "integer", "title": "The font size ", "examples": [ 12 ] }, "created": { "type": "string", "title": "Creation datetime ", "examples": [ "2018-07-26T19:37:05.000Z" ] }, "created_by": { "type": "string", "title": "The Creator user name", "examples": [ "admin@pronghorn" ] }, "last_updated": { "type": "string", "title": "The last updated DateTime", "examples": [ "2018-08-02T15:56:12.912Z" ] }, "last_updated_by": { "type": "string", "title": "User that last updated this doc", "examples": [ "5b3496d74da02e9dfa0b2e91" ] }, "lastUpdatedVersion": { "type": "string", "description": "This value corresponds to the version of Automation Studio last used to modify this workflow." }, "canvasVersion": { "type": "number", "const": 3 }, "groups": { "title": "The Groups", "type": "array", "items": { "type": "string" } }, "type": { "type": "string", "title": "The Job type ", "description": "The Job type", "examples": [ "automation" ] }, "variables": { "$ref": "#/definitions/variables" }, "decorators": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "encryption" ] }, "pointer": { "type": "string", "examples": [ "/variables/input" ] } } } }, "incomingRefs": { "type": "object", "description": "Incoming refs, pointers start at the task.variables", "oneOf": [ { "$ref": "#/definitions/staticPointer" }, { "$ref": "#/definitions/jobVarPointer" }, { "$ref": "#/definitions/taskRefPointer" }, { "$ref": "#/definitions/templatePointer" } ] }, "outgoingRefs": { "type": "object", "description": "Outgoing refs, pointers start at the task.variables", "oneOf": [ { "$ref": "#/definitions/taskOutgoingPointer" }, { "$ref": "#/definitions/jobVarOutgoingPointer" } ] }, "ancestors": { "type": "array", "items": { "$ref": "wfEngineCommon#/definitions/mongoObjectId" } }, "watchers": { "type": "array", "title": "The Watchers", "description": "The ids of the users watching this job", "items": { "$ref": "wfEngineCommon#/definitions/mongoObjectId" } }, "preAutomationTime": { "type": "integer", "title": "Pre automation time of automation", "description": "Time (milliseconds) automation would have taken someone to complete without using IAP.", "examples": [ 5000, 250000 ] }, "metrics": { "$ref": "metricsDefault" }, "status": { "$ref": "#/definitions/status" }, "error": { "type": "array", "title": "The errors", "description": "Array of errors that occurred during the running of this job", "items": { "$ref": "#/definitions/jobError" } }, "encodingVersion": { "type": "integer" } } }