Creating Task Definitions
Tasks can be created using the tasks metadata API
POST /api/metadata/taskdef
This API takes an array of new task definitions.
Examples
Example using curl
curl 'http://localhost:8080/api/metadata/taskdef' \
-H 'accept: */*' \
-H 'content-type: application/json' \
--data-raw '[{"createdBy":"user","name":"sample_task_name_1","description":"This is a sample task for demo","responseTimeoutSeconds":10,"timeoutSeconds":30,"inputKeys":[],"outputKeys":[],"timeoutPolicy":"TIME_OUT_WF","retryCount":3,"retryLogic":"FIXED","retryDelaySeconds":5,"inputTemplate":{},"rateLimitPerFrequency":0,"rateLimitFrequencyInSeconds":1}]'
Example using node fetch
fetch("http://localhost:8080/api/metadata/taskdef", {
"headers": {
"accept": "*/*",
"content-type": "application/json",
},
"body": "[{\"createdBy\":\"user\",\"name\":\"sample_task_name_1\",\"description\":\"This is a sample task for demo\",\"responseTimeoutSeconds\":10,\"timeoutSeconds\":30,\"inputKeys\":[],\"outputKeys\":[],\"timeoutPolicy\":\"TIME_OUT_WF\",\"retryCount\":3,\"retryLogic\":\"FIXED\",\"retryDelaySeconds\":5,\"inputTemplate\":{},\"rateLimitPerFrequency\":0,\"rateLimitFrequencyInSeconds\":1}]",
"method": "POST"
});
Best Practices
- You can update a set of tasks together in this API
- Task configurations are important attributes that controls the behavior of this task in a Workflow. Refer to Task Configurations for all the options and details'
- You can also use the Conductor Swagger UI to update the tasks