AliyunBaiLian icon

AliyunBaiLian

使用阿里云百炼API

Actions4

Overview

This node interacts with the Aliyun BaiLian API to query the results of asynchronous image or video generation tasks. Specifically, for the "任务结果" (Task Result) resource and the "查询异步图像任务结果" (Query Asynchronous Image Task Result) operation, it retrieves the status and output of a previously submitted image generation task by its task ID.

The node supports optionally waiting and polling until the task completes, which is useful when you want to pause workflow execution until the generated image is ready. This makes it suitable for workflows that depend on AI-generated images and need to handle asynchronous processing transparently.

Practical examples:

  • After submitting an image generation request in a previous step, use this node to check if the image is ready.
  • Automatically wait and poll for the image generation completion before proceeding to further steps like saving or sending the image.
  • Handle failed tasks gracefully by continuing the workflow or capturing error details.

Properties

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

Output

The node outputs JSON data representing the full response from the Aliyun BaiLian API about the queried task. This includes:

  • Task metadata such as task_id, task_status (e.g., SUCCEEDED, FAILED, or in-progress states).
  • If completed successfully, the output will contain the generated image data or related URLs.
  • If polling is enabled, the node waits and returns the final task result once available.
  • In case of failure and if continueOnFail is true, the output JSON will include an error field describing the failure.

No binary data is directly output by this node; all information is contained within the JSON structure.

Dependencies

  • Requires an API key credential for the Aliyun BaiLian service.
  • Uses the Axios HTTP client internally to make REST API calls.
  • The node expects network access to https://dashscope.aliyuncs.com/api/v1/tasks/{taskId} endpoint.
  • Polling logic depends on configurable intervals and maximum wait times.

Troubleshooting

  • Common issues:

    • Invalid or expired API key causing authentication failures.
    • Incorrect or non-existent task ID leading to 404 or empty responses.
    • Network connectivity problems preventing API calls.
    • Task taking longer than the configured max wait time, resulting in timeout errors.
  • Error messages:

    • "轮询任务结果失败: <message>" ("Polling task result failed") indicates an error occurred during polling. Check network and API key validity.
    • Errors thrown by Axios or HTTP requests usually indicate connectivity or authorization issues.
    • If continueOnFail is false, any failure will stop the workflow with an error; setting it to true allows the workflow to continue and outputs error details instead.
  • Resolutions:

    • Verify the API key credential is correctly set and has necessary permissions.
    • Confirm the task ID is correct and corresponds to a valid submitted task.
    • Adjust polling interval and max wait time according to expected task duration.
    • Ensure stable internet connection and no firewall blocking outbound requests.

Links and References

Discussion