AliyunBaiLian icon

AliyunBaiLian

使用阿里云百炼API

Actions4

Overview

This node interacts with the Aliyun BaiLian API to query the results of asynchronous video tasks. It is designed to check the status and retrieve the output of video processing jobs that were previously submitted for generation or transformation. The node supports both immediate querying and continuous polling until the task completes, making it useful in workflows where subsequent steps depend on the completion of video processing.

Common scenarios:

  • Retrieving the final video output after submitting a video generation request.
  • Monitoring long-running video processing tasks by periodically checking their status.
  • Handling failed tasks gracefully while continuing workflow execution.

Practical example:
You submit a video generation job to the Aliyun BaiLian service and want your workflow to wait until the video is ready before proceeding. This node can poll the task status every few seconds and return the completed video data once available.


Properties

Name Meaning
任务 ID (taskId) The unique identifier of the video task you want to query.
是否持续轮询任务结果 (waitingForTask) Whether to keep polling the task status until it finishes (true/false).
轮询时间间隔 (毫秒) (interval) The time interval in milliseconds between each status check when polling is enabled.
最长等待时间 (秒) (maxWaitTime) The maximum time in seconds to wait for the task to complete during polling.
如果任务失败怎么处理 (continueOnFail) Whether to continue executing the workflow even if the task fails (true/false).

Output

The node outputs JSON objects representing the queried task result. The structure typically includes:

  • task_id: The ID of the queried task.
  • task_status: Current status of the task (e.g., "SUCCEEDED", "FAILED", or other intermediate states).
  • output: Contains the actual result data of the task if available.
  • error: Present only if an error occurred during querying or polling.

If polling is enabled, the node waits until the task reaches a terminal state (success or failure) or the maximum wait time is exceeded, then returns the final task data.

No binary data output is indicated by the code; all outputs are JSON-formatted.


Dependencies

  • Requires an API key credential for authenticating requests to the Aliyun BaiLian API.
  • Uses the Axios HTTP client library internally to make REST API calls.
  • The node depends on a helper function (pollTaskStatus) to implement the polling mechanism, which repeatedly queries the task status endpoint until completion or timeout.

Troubleshooting

  • Common issues:

    • Invalid or expired API key causing authentication failures.
    • Providing an incorrect or non-existent task ID leading to "not found" errors.
    • Network connectivity problems preventing API requests.
    • Task taking longer than the specified max wait time, resulting in incomplete results.
  • Error messages:

    • "轮询任务结果失败: <message>" ("Polling task result failed") indicates an error occurred during the polling process. Check network connectivity and API key validity.
    • Errors thrown when the task ID is invalid or the API returns an error will be included in the output if continueOnFail is true; otherwise, they will stop the workflow execution.
  • Resolutions:

    • Verify the API key and ensure it has proper permissions.
    • Confirm the task ID is correct and corresponds to an existing task.
    • Increase the max wait time if tasks regularly take longer to complete.
    • Enable continueOnFail to allow workflows to proceed despite individual task failures.

Links and References

Discussion