Overview
This node checks the status of a task in the PiAPI system by querying the task ID. It is useful for workflows that need to monitor or retrieve results from asynchronous media processing tasks, such as image or video generation or transformation. The node can return either the full task data, just the media URL (image or video), or the actual media content as binary data.
Practical examples:
- After submitting a media processing job to PiAPI, use this node to poll and get the current status and output.
- Retrieve only the URL of the generated image or video to pass it downstream.
- Download the media file directly into the workflow as binary data for further processing or storage.
Properties
| Name | Meaning |
|---|---|
| Task ID | The unique identifier of the PiAPI task to check. Can be set manually or inferred from input data fields. |
| Return Only Media URL | If true, returns only the URL of the image or video instead of the full task details. |
| Return Binary Data | If true, downloads the image or video and returns it as binary data in the specified binary property. |
| Binary Property | The name of the binary property where the downloaded media will be stored if "Return Binary Data" is true. |
Output
The node outputs an array with one item per input. Each item contains:
jsonobject with:code: HTTP-like status code (200 on success, 400 on error).data: The full task data returned from PiAPI, including metadata and output URLs.mediaUrl(optional): The direct URL to the image or video if "Return Only Media URL" is enabled.type(optional): Indicates whether the media is an "image" or "video".message: Status message, usually "success" or an error description.
binaryobject (optional):- Contains the media file data if "Return Binary Data" is enabled, stored under the user-defined binary property name.
Dependencies
- Requires an API key credential for authenticating with the PiAPI service.
- Uses an internal helper function to make authenticated HTTP requests to PiAPI endpoints.
- Requires network access to PiAPI and to the media URLs for downloading binary data.
Troubleshooting
- Missing Task ID: The node requires a valid task ID either set explicitly or available in the input data. If missing, it throws an error.
- Failed to retrieve task: If the PiAPI request fails or returns an unexpected response, the node throws an error with the message from PiAPI.
- Binary download issues: When returning binary data, network errors or invalid URLs may cause failures.
- To handle errors gracefully, enable "Continue On Fail" in the node settings to receive error messages in the output instead of stopping execution.
Links and References
- PiAPI Documentation (hypothetical link)
- n8n documentation on working with binary data
- n8n documentation on credentials