UNC任务执行 icon

UNC任务执行

UNC任务执行

Overview

This node, named "UNC Task Create," is designed to create and submit a task request to an external task execution service. It is useful in scenarios where you need to programmatically trigger asynchronous tasks or workflows by specifying task details such as the task ID, queue, parameters, and timeout. For example, it can be used to enqueue audit tasks or other custom jobs in a distributed system that processes tasks based on queues.

The node generates a unique task identifier, sends the task creation request to a configured API endpoint, and then waits for the task result or status with a specified timeout. This allows n8n workflows to integrate with external task processing systems seamlessly.

Properties

Name Meaning
任务ID The parent task ID to associate with this new task. Required string input.
任务队列 The name of the task queue where the task should be submitted. Required string input.
任务参数 Parameters for the task, provided as a string. Required input describing task-specific data.
超时时间 Timeout duration in seconds to wait for the task completion or response. Required number input.

Output

The node outputs JSON data representing the result or status of the created task. The output JSON structure includes information returned from the external task system after task submission and any cached task results retrieved during the waiting period.

  • The json output contains the task response details.
  • If the task fails or times out, error information may be included in the output if the node is configured to continue on failure.
  • No binary data output is produced by this node.

Dependencies

  • Requires an external API endpoint URL configured via credentials (an API key or authentication token) to authenticate and send task requests.
  • Uses the axios library for HTTP POST requests.
  • Utilizes a UUID generator to create unique task IDs.
  • Depends on a utility function (createCacheTask) to handle task caching and waiting logic.
  • The node expects the user to configure credentials containing the API address for the task execution service.

Troubleshooting

  • Common issues:
    • Incorrect or missing API endpoint address in credentials will cause connection failures.
    • Invalid or malformed task parameters may lead to task rejection by the external service.
    • Timeout values set too low might cause premature task termination or incomplete results.
  • Error messages:
    • Network errors or HTTP errors from the external API will be thrown; ensure the API address is reachable and correct.
    • If the node throws errors related to missing credentials, verify that the required API authentication is properly configured.
    • Parsing errors may occur if task parameters are not formatted as expected by the external service.

Links and References

Discussion