{"openapi":"3.0.4","info":{"title":"Create a new Task Definition","version":"0.0.1"},"servers":[{"url":"https://fbn-prd.lusid.com/workflow"}],"paths":{"/api/taskdefinitions":{"post":{"tags":["Task Definitions"],"summary":"Create a new Task Definition","operationId":"CreateTaskDefinition","requestBody":{"description":"The data to create a Task Definition","content":{"application/json-patch+json":{"schema":{"$ref":"/docs/api/workflow/schemas.json#/components/schemas/CreateTaskDefinitionRequest"},"example":{"id":{"scope":"A1","code":"ZZZ"},"displayName":"An example TaskDefinition","description":"Test","states":[{"name":"Submitted","displayName":"Submitted","description":"Submitted ready to start","category":"NotStarted"},{"name":"InProgress","displayName":"In progress","description":"In progress","category":"InProgress"},{"name":"SendingSurvey","displayName":"In Progress sending survey","description":"Sending survey","category":"InProgress"},{"name":"Done","displayName":"Done","description":"Task has finished successfully","category":"CompletedSuccess"},{"name":"SurveyNotSent","displayName":"Survey Not Sent","description":"Survey has  not been sent","category":"InProgress"},{"name":"NotDone","displayName":"Not Done","description":"Task is not done","category":"Other"}],"fieldSchema":[{"name":"clientId","type":"String","displayName":"Client Id","description":"Id for the client","containsUrl":false},{"name":"assignee","type":"String","readOnlyStates":{"stateType":"SelectedStates","selectedStates":["Submitted","Done","SurveyNotSent","NotDone"]}},{"name":"resolutionDetail","type":"String","readOnlyStates":{"stateType":"TerminalState"},"category":"LargetextArea"}],"initialState":{"name":"Submitted","requiredFields":["clientId"]},"triggers":[{"name":"start","trigger":{"type":"External"},"displayName":"Start","description":"Start the task"},{"name":"cancel","trigger":{"type":"External"}},{"name":"resolve","trigger":{"type":"External"}},{"name":"timeout","trigger":{"type":"External"}},{"name":"success","trigger":{"type":"External"}},{"name":"failure","trigger":{"type":"External"}}],"transitions":[{"fromState":"Submitted","toState":"InProgress","trigger":"start","guard":"fields['assignee'] exists AND fields['assignee'] NOT eq ''","displayName":"Start","description":"Start the worker","guardDescription":"Field assignee exists","guardConditionNotMetMessage":"Assignee does not exist"},{"fromState":"InProgress","toState":"SendingSurvey","trigger":"resolve","guard":"fields['resolutionDetail'] exists AND fields['resolutionDetail'] NOT eq ''","action":"health-check"},{"fromState":"SendingSurvey","toState":"Done","trigger":"success"},{"fromState":"SendingSurvey","toState":"SurveyNotSent","trigger":"failure"},{"fromState":"SendingSurvey","toState":"NotDone","trigger":"timeout"},{"fromState":"InProgress","toState":"NotDone","trigger":"cancel","guard":"fields['cancellationDetail'] exists AND fields['cancellationDetail'] NOT eq ''"}],"actions":[{"name":"health-check","runAsUserId":"user-id","actionDetails":{"type":"RunWorker","workerId":{"scope":"Health","code":"HealthCheckWorker"},"workerAsAt":"2022-01-01T01:02:03.0000000+00:00","workerParameters":{},"workerStatusTriggers":{"started":null,"completedWithResults":null,"completedNoResults":null,"failedToStart":null,"failedToComplete":null},"childTaskConfigurations":[{"taskDefinitionId":{"scope":"AAA","code":"BBB"},"mapStackingKeyFrom":null,"childTaskFields":{"assignee":{"mapFrom":"foo","setTo":"bar"}},"resultMatchingPattern":null,"taskDefinitionAsAt":null,"initialTrigger":"test-trigger"}],"workerTimeout":120},"displayName":"Health Check","description":"Health check"}]}},"application/json":{"schema":{"$ref":"/docs/api/workflow/schemas.json#/components/schemas/CreateTaskDefinitionRequest"},"example":{"id":{"scope":"A1","code":"ZZZ"},"displayName":"An example TaskDefinition","description":"Test","states":[{"name":"Submitted","displayName":"Submitted","description":"Submitted ready to start","category":"NotStarted"},{"name":"InProgress","displayName":"In progress","description":"In progress","category":"InProgress"},{"name":"SendingSurvey","displayName":"In Progress sending survey","description":"Sending survey","category":"InProgress"},{"name":"Done","displayName":"Done","description":"Task has finished successfully","category":"CompletedSuccess"},{"name":"SurveyNotSent","displayName":"Survey Not Sent","description":"Survey has  not been sent","category":"InProgress"},{"name":"NotDone","displayName":"Not Done","description":"Task is not done","category":"Other"}],"fieldSchema":[{"name":"clientId","type":"String","displayName":"Client Id","description":"Id for the client","containsUrl":false},{"name":"assignee","type":"String","readOnlyStates":{"stateType":"SelectedStates","selectedStates":["Submitted","Done","SurveyNotSent","NotDone"]}},{"name":"resolutionDetail","type":"String","readOnlyStates":{"stateType":"TerminalState"},"category":"LargetextArea"}],"initialState":{"name":"Submitted","requiredFields":["clientId"]},"triggers":[{"name":"start","trigger":{"type":"External"},"displayName":"Start","description":"Start the task"},{"name":"cancel","trigger":{"type":"External"}},{"name":"resolve","trigger":{"type":"External"}},{"name":"timeout","trigger":{"type":"External"}},{"name":"success","trigger":{"type":"External"}},{"name":"failure","trigger":{"type":"External"}}],"transitions":[{"fromState":"Submitted","toState":"InProgress","trigger":"start","guard":"fields['assignee'] exists AND fields['assignee'] NOT eq ''","displayName":"Start","description":"Start the worker","guardDescription":"Field assignee exists","guardConditionNotMetMessage":"Assignee does not exist"},{"fromState":"InProgress","toState":"SendingSurvey","trigger":"resolve","guard":"fields['resolutionDetail'] exists AND fields['resolutionDetail'] NOT eq ''","action":"health-check"},{"fromState":"SendingSurvey","toState":"Done","trigger":"success"},{"fromState":"SendingSurvey","toState":"SurveyNotSent","trigger":"failure"},{"fromState":"SendingSurvey","toState":"NotDone","trigger":"timeout"},{"fromState":"InProgress","toState":"NotDone","trigger":"cancel","guard":"fields['cancellationDetail'] exists AND fields['cancellationDetail'] NOT eq ''"}],"actions":[{"name":"health-check","runAsUserId":"user-id","actionDetails":{"type":"RunWorker","workerId":{"scope":"Health","code":"HealthCheckWorker"},"workerAsAt":"2022-01-01T01:02:03.0000000+00:00","workerParameters":{},"workerStatusTriggers":{"started":null,"completedWithResults":null,"completedNoResults":null,"failedToStart":null,"failedToComplete":null},"childTaskConfigurations":[{"taskDefinitionId":{"scope":"AAA","code":"BBB"},"mapStackingKeyFrom":null,"childTaskFields":{"assignee":{"mapFrom":"foo","setTo":"bar"}},"resultMatchingPattern":null,"taskDefinitionAsAt":null,"initialTrigger":"test-trigger"}],"workerTimeout":120},"displayName":"Health Check","description":"Health check"}]}},"text/json":{"schema":{"$ref":"/docs/api/workflow/schemas.json#/components/schemas/CreateTaskDefinitionRequest"},"example":{"id":{"scope":"A1","code":"ZZZ"},"displayName":"An example TaskDefinition","description":"Test","states":[{"name":"Submitted","displayName":"Submitted","description":"Submitted ready to start","category":"NotStarted"},{"name":"InProgress","displayName":"In progress","description":"In progress","category":"InProgress"},{"name":"SendingSurvey","displayName":"In Progress sending survey","description":"Sending survey","category":"InProgress"},{"name":"Done","displayName":"Done","description":"Task has finished successfully","category":"CompletedSuccess"},{"name":"SurveyNotSent","displayName":"Survey Not Sent","description":"Survey has  not been sent","category":"InProgress"},{"name":"NotDone","displayName":"Not Done","description":"Task is not done","category":"Other"}],"fieldSchema":[{"name":"clientId","type":"String","displayName":"Client Id","description":"Id for the client","containsUrl":false},{"name":"assignee","type":"String","readOnlyStates":{"stateType":"SelectedStates","selectedStates":["Submitted","Done","SurveyNotSent","NotDone"]}},{"name":"resolutionDetail","type":"String","readOnlyStates":{"stateType":"TerminalState"},"category":"LargetextArea"}],"initialState":{"name":"Submitted","requiredFields":["clientId"]},"triggers":[{"name":"start","trigger":{"type":"External"},"displayName":"Start","description":"Start the task"},{"name":"cancel","trigger":{"type":"External"}},{"name":"resolve","trigger":{"type":"External"}},{"name":"timeout","trigger":{"type":"External"}},{"name":"success","trigger":{"type":"External"}},{"name":"failure","trigger":{"type":"External"}}],"transitions":[{"fromState":"Submitted","toState":"InProgress","trigger":"start","guard":"fields['assignee'] exists AND fields['assignee'] NOT eq ''","displayName":"Start","description":"Start the worker","guardDescription":"Field assignee exists","guardConditionNotMetMessage":"Assignee does not exist"},{"fromState":"InProgress","toState":"SendingSurvey","trigger":"resolve","guard":"fields['resolutionDetail'] exists AND fields['resolutionDetail'] NOT eq ''","action":"health-check"},{"fromState":"SendingSurvey","toState":"Done","trigger":"success"},{"fromState":"SendingSurvey","toState":"SurveyNotSent","trigger":"failure"},{"fromState":"SendingSurvey","toState":"NotDone","trigger":"timeout"},{"fromState":"InProgress","toState":"NotDone","trigger":"cancel","guard":"fields['cancellationDetail'] exists AND fields['cancellationDetail'] NOT eq ''"}],"actions":[{"name":"health-check","runAsUserId":"user-id","actionDetails":{"type":"RunWorker","workerId":{"scope":"Health","code":"HealthCheckWorker"},"workerAsAt":"2022-01-01T01:02:03.0000000+00:00","workerParameters":{},"workerStatusTriggers":{"started":null,"completedWithResults":null,"completedNoResults":null,"failedToStart":null,"failedToComplete":null},"childTaskConfigurations":[{"taskDefinitionId":{"scope":"AAA","code":"BBB"},"mapStackingKeyFrom":null,"childTaskFields":{"assignee":{"mapFrom":"foo","setTo":"bar"}},"resultMatchingPattern":null,"taskDefinitionAsAt":null,"initialTrigger":"test-trigger"}],"workerTimeout":120},"displayName":"Health Check","description":"Health check"}]}},"application/*+json":{"schema":{"$ref":"/docs/api/workflow/schemas.json#/components/schemas/CreateTaskDefinitionRequest"},"example":{"id":{"scope":"A1","code":"ZZZ"},"displayName":"An example TaskDefinition","description":"Test","states":[{"name":"Submitted","displayName":"Submitted","description":"Submitted ready to start","category":"NotStarted"},{"name":"InProgress","displayName":"In progress","description":"In progress","category":"InProgress"},{"name":"SendingSurvey","displayName":"In Progress sending survey","description":"Sending survey","category":"InProgress"},{"name":"Done","displayName":"Done","description":"Task has finished successfully","category":"CompletedSuccess"},{"name":"SurveyNotSent","displayName":"Survey Not Sent","description":"Survey has  not been sent","category":"InProgress"},{"name":"NotDone","displayName":"Not Done","description":"Task is not done","category":"Other"}],"fieldSchema":[{"name":"clientId","type":"String","displayName":"Client Id","description":"Id for the client","containsUrl":false},{"name":"assignee","type":"String","readOnlyStates":{"stateType":"SelectedStates","selectedStates":["Submitted","Done","SurveyNotSent","NotDone"]}},{"name":"resolutionDetail","type":"String","readOnlyStates":{"stateType":"TerminalState"},"category":"LargetextArea"}],"initialState":{"name":"Submitted","requiredFields":["clientId"]},"triggers":[{"name":"start","trigger":{"type":"External"},"displayName":"Start","description":"Start the task"},{"name":"cancel","trigger":{"type":"External"}},{"name":"resolve","trigger":{"type":"External"}},{"name":"timeout","trigger":{"type":"External"}},{"name":"success","trigger":{"type":"External"}},{"name":"failure","trigger":{"type":"External"}}],"transitions":[{"fromState":"Submitted","toState":"InProgress","trigger":"start","guard":"fields['assignee'] exists AND fields['assignee'] NOT eq ''","displayName":"Start","description":"Start the worker","guardDescription":"Field assignee exists","guardConditionNotMetMessage":"Assignee does not exist"},{"fromState":"InProgress","toState":"SendingSurvey","trigger":"resolve","guard":"fields['resolutionDetail'] exists AND fields['resolutionDetail'] NOT eq ''","action":"health-check"},{"fromState":"SendingSurvey","toState":"Done","trigger":"success"},{"fromState":"SendingSurvey","toState":"SurveyNotSent","trigger":"failure"},{"fromState":"SendingSurvey","toState":"NotDone","trigger":"timeout"},{"fromState":"InProgress","toState":"NotDone","trigger":"cancel","guard":"fields['cancellationDetail'] exists AND fields['cancellationDetail'] NOT eq ''"}],"actions":[{"name":"health-check","runAsUserId":"user-id","actionDetails":{"type":"RunWorker","workerId":{"scope":"Health","code":"HealthCheckWorker"},"workerAsAt":"2022-01-01T01:02:03.0000000+00:00","workerParameters":{},"workerStatusTriggers":{"started":null,"completedWithResults":null,"completedNoResults":null,"failedToStart":null,"failedToComplete":null},"childTaskConfigurations":[{"taskDefinitionId":{"scope":"AAA","code":"BBB"},"mapStackingKeyFrom":null,"childTaskFields":{"assignee":{"mapFrom":"foo","setTo":"bar"}},"resultMatchingPattern":null,"taskDefinitionAsAt":null,"initialTrigger":"test-trigger"}],"workerTimeout":120},"displayName":"Health Check","description":"Health check"}]}}},"required":true},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"/docs/api/workflow/schemas.json#/components/schemas/TaskDefinition"},"example":{"id":{"scope":"A1","code":"ZZZ"},"version":{"asAtCreated":"2022-01-01T01:02:03.0000000+00:00","userIdCreated":"User-1","requestIdCreated":"RequestId-1","asAtModified":"2022-01-01T01:02:03.0000000+00:00","userIdModified":"User-1","requestIdModified":"RequestId-1","asAtVersionNumber":1},"displayName":"An example TaskDefinition","description":"Test","states":[{"name":"Submitted","displayName":"Submitted","description":"Submitted ready to start","category":"NotStarted"},{"name":"InProgress","displayName":"In progress","description":"In progress","category":"InProgress"},{"name":"SendingSurvey","displayName":"In Progress sending survey","description":"Sending survey","category":"InProgress"},{"name":"Done","displayName":"Done","description":"Task has finished successfully","category":"CompletedSuccess"},{"name":"SurveyNotSent","displayName":"Survey Not Sent","description":"Survey has  not been sent","category":"InProgress"},{"name":"NotDone","displayName":"Not Done","description":"Task is not done","category":"Other"}],"fieldSchema":[{"name":"clientId","type":"String","displayName":"Client Id","description":"Id for the client","containsUrl":false},{"name":"assignee","type":"String","readOnlyStates":{"stateType":"SelectedStates","selectedStates":["Submitted","Done","SurveyNotSent","NotDone"]}},{"name":"resolutionDetail","type":"String","readOnlyStates":{"stateType":"TerminalState"},"category":"LargetextArea"}],"initialState":{"name":"Submitted","requiredFields":["clientId"]},"triggers":[{"name":"start","trigger":{"type":"External"},"displayName":"Start","description":"Start the task"},{"name":"cancel","trigger":{"type":"External"}},{"name":"resolve","trigger":{"type":"External"}},{"name":"timeout","trigger":{"type":"External"}},{"name":"success","trigger":{"type":"External"}},{"name":"failure","trigger":{"type":"External"}}],"actions":[{"name":"health-check","runAsUserId":"user-id","actionDetails":{"type":"RunWorker","workerId":{"scope":"Health","code":"HealthCheckWorker"},"workerAsAt":"2022-01-01T01:02:03.0000000+00:00","workerParameters":{},"workerStatusTriggers":{"started":null,"completedWithResults":null,"completedNoResults":null,"failedToStart":null,"failedToComplete":null},"childTaskConfigurations":[{"taskDefinitionId":{"scope":"AAA","code":"BBB"},"mapStackingKeyFrom":null,"childTaskFields":{"assignee":{"mapFrom":"foo","setTo":"bar"}},"resultMatchingPattern":null,"taskDefinitionAsAt":null,"initialTrigger":"test-trigger"}],"workerTimeout":120},"displayName":"Health Check","description":"Health check"}],"transitions":[{"fromState":"Submitted","toState":"InProgress","trigger":"start","guard":"fields['assignee'] exists AND fields['assignee'] NOT eq ''","displayName":"Start","description":"Start the worker","guardDescription":"Field assignee exists","guardConditionNotMetMessage":"Assignee does not exist"},{"fromState":"InProgress","toState":"SendingSurvey","trigger":"resolve","guard":"fields['resolutionDetail'] exists AND fields['resolutionDetail'] NOT eq ''","action":"health-check"},{"fromState":"SendingSurvey","toState":"Done","trigger":"success"},{"fromState":"SendingSurvey","toState":"SurveyNotSent","trigger":"failure"},{"fromState":"SendingSurvey","toState":"NotDone","trigger":"timeout"},{"fromState":"InProgress","toState":"NotDone","trigger":"cancel","guard":"fields['cancellationDetail'] exists AND fields['cancellationDetail'] NOT eq ''"}]}}}},"400":{"description":"The details of the input related failure","content":{"application/json":{"schema":{"$ref":"/docs/api/workflow/schemas.json#/components/schemas/LusidValidationProblemDetails"}}}},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"/docs/api/workflow/schemas.json#/components/schemas/LusidProblemDetails"}}}}},"security":[{"BearerAuth":[]}],"x-fbn-apistatus":"Stable"}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}}}}