@burgan-tech/vnext-schema
Version:
JSON Schema definitions for vNext vNext Workflow components validation
789 lines • 34.6 kB
JSON
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://vnext.io/schemas/task-definition.schema.json",
"title": "vNext Task Definition",
"description": "Schema for vNext Task Component Definition JSON files (sys-tasks flow)",
"type": "object",
"required": [
"key",
"version",
"domain",
"flow",
"flowVersion",
"tags",
"attributes"
],
"properties": {
"$schema": {
"type": "string",
"description": "JSON Schema reference"
},
"key": {
"type": "string",
"description": "Task key identifier",
"pattern": "^[a-z0-9-]+$"
},
"version": {
"type": "string",
"description": "Version in Major.Minor.Patch format",
"pattern": "^\\d+\\.\\d+\\.\\d+$"
},
"domain": {
"type": "string",
"description": "Domain identifier",
"pattern": "^[a-z0-9-]+$"
},
"flow": {
"type": "string",
"description": "Flow identifier for tasks",
"const": "sys-tasks"
},
"flowVersion": {
"type": "string",
"description": "Flow version",
"pattern": "^\\d+\\.\\d+\\.\\d+$"
},
"tags": {
"type": "array",
"description": "Task tags",
"items": {
"type": "string"
},
"minItems": 1
},
"_comment": {
"type": "string",
"description": "Comment about the task"
},
"attributes": {
"type": "object",
"description": "Task definition attributes",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"description": "Task type (TaskType enum value as string)",
"enum": [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
"13",
"14"
],
"enumDescriptions": [
"Dapr HTTP Endpoint",
"Dapr Binding",
"Dapr Service",
"Dapr PubSub",
"Human Task",
"HTTP Task",
"Script Task",
"Condition Task",
"Timer Task",
"Notification Task",
"Start Flow Task",
"Trigger Transition Task",
"Get Instance Data Task",
"SubProcess Task"
]
}
},
"allOf": [
{
"if": {
"properties": {
"type": {
"const": "1"
}
}
},
"then": {
"properties": {
"type": {
"const": "1"
},
"config": {
"type": "object",
"description": "Dapr HTTP Endpoint configuration",
"properties": {
"endpointName": {
"type": "string",
"description": "Dapr HTTP endpoint name"
},
"path": {
"type": "string",
"description": "HTTP endpoint path"
},
"method": {
"type": "string",
"enum": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH"
],
"description": "HTTP method"
},
"body": {
"type": "object",
"description": "Service call body"
}
},
"required": [
"endpointName",
"path",
"method"
],
"additionalProperties": false
}
},
"required": [
"type",
"config"
],
"additionalProperties": false
}
},
{
"if": {
"properties": {
"type": {
"const": "2"
}
}
},
"then": {
"properties": {
"type": {
"const": "2"
},
"config": {
"type": "object",
"description": "Dapr Binding configuration",
"properties": {
"bindingName": {
"type": "string",
"description": "Dapr binding name"
},
"operation": {
"type": "string",
"description": "Binding operation"
},
"metadata": {
"type": "object",
"description": "Binding metadata"
},
"data": {
"type": "object",
"description": "Binding data"
}
},
"required": [
"bindingName",
"operation"
],
"additionalProperties": false
}
},
"required": [
"type",
"config"
],
"additionalProperties": false
}
},
{
"if": {
"properties": {
"type": {
"const": "3"
}
}
},
"then": {
"properties": {
"type": {
"const": "3"
},
"config": {
"type": "object",
"description": "Dapr Service configuration",
"properties": {
"appId": {
"type": "string",
"description": "Dapr app ID"
},
"methodName": {
"type": "string",
"description": "Service method name"
},
"httpVerb": {
"type": "string",
"enum": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH"
],
"description": "HTTP verb"
},
"body": {
"type": "object",
"description": "Service call body"
},
"headers": {
"type": "object",
"description": "Service call headers"
},
"queryString": {
"type": "string",
"description": "Query string parameters"
},
"timeoutSeconds": {
"type": "integer",
"minimum": 1,
"description": "Timeout in seconds"
}
},
"required": [
"appId",
"methodName"
],
"additionalProperties": false
}
},
"required": [
"type",
"config"
],
"additionalProperties": false
}
},
{
"if": {
"properties": {
"type": {
"const": "4"
}
}
},
"then": {
"properties": {
"type": {
"const": "4"
},
"config": {
"type": "object",
"description": "Dapr PubSub configuration",
"properties": {
"pubSubName": {
"type": "string",
"description": "PubSub component name"
},
"topic": {
"type": "string",
"description": "Topic name"
},
"data": {
"type": "object",
"description": "Message data"
},
"metadata": {
"type": "object",
"description": "Message metadata"
}
},
"required": [
"pubSubName",
"topic"
],
"additionalProperties": false
}
},
"required": [
"type",
"config"
],
"additionalProperties": false
}
},
{
"if": {
"properties": {
"type": {
"const": "5"
}
}
},
"then": {
"properties": {
"type": {
"const": "5"
},
"config": {
"type": "object",
"description": "Human Task configuration",
"properties": {
"title": {
"type": "string",
"description": "Task title",
"minLength": 1
},
"instructions": {
"type": "string",
"description": "Task instructions",
"minLength": 1
},
"assignedTo": {
"type": "string",
"description": "Assigned person/group",
"minLength": 1
},
"dueDate": {
"type": [
"string",
"null"
],
"description": "Due date (ISO 8601 format)",
"format": "date-time"
},
"form": {
"description": "Form definition in JSON format"
},
"reminderIntervalMinutes": {
"type": "integer",
"description": "Reminder interval in minutes",
"minimum": 0
},
"escalationTimeoutMinutes": {
"type": "integer",
"description": "Escalation timeout in minutes",
"minimum": 0
},
"escalationAssignee": {
"type": "string",
"description": "Escalation assignee"
}
},
"required": [
"title",
"instructions",
"assignedTo"
],
"additionalProperties": false
}
},
"required": [
"type",
"config"
],
"additionalProperties": false
}
},
{
"if": {
"properties": {
"type": {
"const": "6"
}
}
},
"then": {
"properties": {
"type": {
"const": "6"
},
"config": {
"type": "object",
"description": "HTTP Task configuration",
"properties": {
"url": {
"type": "string",
"description": "HTTP URL"
},
"method": {
"type": "string",
"enum": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH"
],
"description": "HTTP method"
},
"headers": {
"type": "object",
"description": "HTTP headers"
},
"body": {
"type": "object",
"description": "HTTP request body"
},
"timeoutSeconds": {
"type": "integer",
"minimum": 1,
"description": "Timeout in seconds"
},
"validateSsl": {
"type": "boolean",
"description": "Whether to validate SSL certificates"
}
},
"required": [
"url",
"method"
],
"additionalProperties": false
}
},
"required": [
"type",
"config"
],
"additionalProperties": false
}
},
{
"if": {
"properties": {
"type": {
"const": "7"
}
}
},
"then": {
"properties": {
"type": {
"const": "7"
},
"config": {
"type": "object",
"description": "Script Task configuration",
"properties": {}
}
},
"required": [
"type",
"config"
],
"additionalProperties": false
}
},
{
"if": {
"properties": {
"type": {
"const": "10"
}
}
},
"then": {
"properties": {
"type": {
"const": "10"
},
"config": {
"type": "object",
"description": "Notification Binding configuration",
"properties": {
"metadata": {
"type": "object",
"description": "Binding metadata"
}
},
"required": [
"metadata"
],
"additionalProperties": false
}
},
"required": [
"type",
"config"
],
"additionalProperties": false
}
},
{
"if": {
"properties": {
"type": {
"const": "11"
}
}
},
"then": {
"title": "StartTrigger Task",
"properties": {
"type": {
"const": "11"
},
"config": {
"type": "object",
"description": "StartTrigger Task configuration - Creates a new workflow instance",
"properties": {
"flow": {
"type": "string",
"description": "Target workflow name",
"minLength": 1
},
"domain": {
"type": "string",
"description": "Target workflow domain",
"minLength": 1
},
"body": {
"type": "object",
"description": "Request body data to send with the start request"
},
"sync": {
"type": "boolean",
"description": "Whether to execute synchronously"
},
"version": {
"type": "string",
"description": "Target workflow version"
},
"key": {
"type": "string",
"description": "Target workflow key"
},
"tags": {
"type": "array",
"description": "Tags for the workflow",
"items": {
"type": "string"
}
}
},
"required": [
"flow",
"domain"
],
"additionalProperties": false
}
},
"required": [
"type",
"config"
],
"additionalProperties": false
}
},
{
"if": {
"properties": {
"type": {
"const": "12"
}
}
},
"then": {
"title": "DirectTrigger Task",
"properties": {
"type": {
"const": "12"
},
"config": {
"type": "object",
"description": "DirectTrigger Task configuration - Executes a transition on a target workflow instance",
"properties": {
"flow": {
"type": "string",
"description": "Target workflow name",
"minLength": 1
},
"domain": {
"type": "string",
"description": "Target workflow domain",
"minLength": 1
},
"transitionName": {
"type": "string",
"description": "Transition name to execute",
"minLength": 1
},
"body": {
"type": "object",
"description": "Request body data to send with the transition request"
},
"sync": {
"type": "boolean",
"description": "Whether to execute synchronously"
},
"version": {
"type": "string",
"description": "Target workflow version"
},
"key": {
"type": "string",
"description": "Target instance key"
},
"instanceId": {
"type": "string",
"description": "Target instance ID (GUID format)",
"format": "uuid"
},
"tags": {
"type": "array",
"description": "Tags for the workflow",
"items": {
"type": "string"
}
}
},
"required": [
"flow",
"domain",
"transitionName"
],
"additionalProperties": false
}
},
"required": [
"type",
"config"
],
"additionalProperties": false
}
},
{
"if": {
"properties": {
"type": {
"const": "13"
}
}
},
"then": {
"title": "GetInstanceData Task",
"properties": {
"type": {
"const": "13"
},
"config": {
"type": "object",
"description": "GetInstanceData Task configuration - Retrieves instance data from a workflow instance",
"properties": {
"flow": {
"type": "string",
"description": "Target workflow name",
"minLength": 1
},
"domain": {
"type": "string",
"description": "Target workflow domain",
"minLength": 1
},
"key": {
"type": "string",
"description": "Target instance key"
},
"instanceId": {
"type": "string",
"description": "Target instance ID (GUID format)",
"format": "uuid"
},
"extensions": {
"type": "array",
"description": "Data extensions to include for enrichment",
"items": {
"type": "string"
}
}
},
"required": [
"flow",
"domain"
],
"additionalProperties": false
}
},
"required": [
"type",
"config"
],
"additionalProperties": false
}
},
{
"if": {
"properties": {
"type": {
"const": "14"
}
}
},
"then": {
"title": "SubProcess Task",
"properties": {
"type": {
"const": "14"
},
"config": {
"type": "object",
"description": "SubProcess Task configuration - Starts a subprocess workflow",
"properties": {
"flow": {
"type": "string",
"description": "Target workflow name",
"minLength": 1
},
"domain": {
"type": "string",
"description": "Target workflow domain",
"minLength": 1
},
"body": {
"type": "object",
"description": "Request body data to send with the subprocess request"
},
"version": {
"type": "string",
"description": "Target workflow version"
},
"key": {
"type": "string",
"description": "Target workflow key"
},
"tags": {
"type": "array",
"description": "Tags for the workflow",
"items": {
"type": "string"
}
}
},
"required": [
"flow",
"domain"
],
"additionalProperties": false
}
},
"required": [
"type",
"config"
],
"additionalProperties": false
}
}
]
}
},
"additionalProperties": false
}