Long Task Node
AI-generatedOverview
This node manages a long-running external task by interacting with APIs and Durable Functions. It creates a task via a POST request, starts a Durable Function to handle the task asynchronously, and periodically polls the function's status until completion or timeout. It updates the task status via PATCH requests during the process. This node is useful for workflows requiring asynchronous processing with external systems, such as orchestrating background jobs or long-running operations in cloud environments.
Use Case Examples
- Creating a task in an external system and monitoring its progress via a Durable Function.
- Updating task status in real-time while waiting for an external process to complete.
- Handling asynchronous workflows that require polling and status updates.
Properties
| Name | Meaning |
|---|---|
| Create Task API URL | The endpoint URL to create a new task via a POST request. |
| Update Task API URL | The endpoint URL to update the task status via a PATCH request. Supports templating with {task_id}. |
| Start Durable Function API URL | The endpoint URL to start the Durable Function via a POST request. Supports templating with {record_id}. |
| Execution ID | An integer representing the execution ID of the record. |
| Orchestrator uri | The URI of the orchestrator function to be used by the Durable Function. |
| Custom Data | A JSON object containing custom data that may change over time and is passed to the Durable Function. |
| Record ID | An integer value passed to the createTaskApi to create a task and used for templating the Durable Function URL. |
| Max Wait Minutes | Maximum number of minutes to wait for the Durable Function to complete before timing out. |
| api token | API token used for authorization in all API requests. |
Output
JSON
success- Boolean indicating if the long-running task completed successfully.message- A message describing the final status or error of the task.
Dependencies
- Requires an API token for authorization to call the external APIs.
Troubleshooting
- Common issues include API request failures due to network errors or invalid tokens, which result in error messages like 'Error creating task' or 'Error starting Durable Function'.
- Timeout errors occur if the Durable Function does not complete within the specified max wait time, resulting in a timeout message.
- Errors updating the task status via PATCH requests may occur if the task ID is incorrect or the API endpoint is unreachable.