HjhComfyUIJson icon

HjhComfyUIJson

Execute HjhComfyUIJson workflows

Overview

This node executes workflows defined in the HjhComfyUIJson format by sending them to one or more configured Hjh services. It is designed to integrate with Hjh services that process JSON-based workflow prompts, queue them for execution, and optionally wait for their completion to retrieve results.

Common scenarios include:

  • Automating image generation or processing pipelines defined as JSON workflows.
  • Integrating complex HjhComfyUIJson workflows into larger n8n automation processes.
  • Using multiple Hjh service endpoints for redundancy or load balancing.

For example, a user can provide a JSON workflow describing an image generation task, send it to the Hjh service, and wait for the output images to be returned for further processing or storage.

Properties

Name Meaning
Use Hjh Services Whether to use provided Hjh services JSON or fallback to credentials for service URLs.
Hjh Services JSON string listing one or more Hjh service URLs (comma-separated) to send the workflow.
Hjh Workflow JSON The JSON definition of the HjhComfyUIJson workflow to execute (required).
Wait For Result Whether to wait for the workflow execution to complete before returning results.
Timeout Maximum time in seconds to wait for workflow completion before timing out.

Output

The node outputs a JSON object with the following structure:

  • code: HTTP-like status code (e.g., 200 for success).
  • message: Status message, e.g., "ok".
  • description: Additional description, usually "ok" on success.
  • files: An array of file paths pointing to output images generated by the workflow. These are local paths constructed from the workflow output metadata.
  • promptResult: The full detailed result object returned by the Hjh service for the prompt, including status and outputs.
  • promptId: The unique identifier assigned to the queued prompt by the Hjh service.

If Wait For Result is false, the node returns immediately after queuing the prompt with empty files and promptResult.

In case of errors, the output contains error details with code 500 and descriptive messages.

The node does not output binary data directly but provides file paths to generated images.

Dependencies

  • Requires access to one or more Hjh service API endpoints that accept HjhComfyUIJson workflows.
  • Optionally requires an API key credential for authenticating requests to the Hjh service.
  • Uses HTTP requests to communicate with the Hjh service's REST API (/system_stats, /prompt, /history/{prompt_id}).
  • No additional external libraries beyond standard n8n helpers and request utilities.

Troubleshooting

  • No available service: If none of the provided or credential-based service URLs respond to the /system_stats endpoint within 1 second, the node throws an error indicating no available service. Ensure the service URLs are correct and reachable.
  • Failed to get prompt ID: If the POST to /prompt does not return a prompt_id, the workflow cannot proceed. Verify the workflow JSON is valid and accepted by the service.
  • Execution timeout: If waiting for the result exceeds the specified timeout, the node throws a timeout error. Increase the timeout or disable waiting if long-running workflows are expected.
  • Workflow execution failed: If the workflow completes with an error status, the node reports failure. Check the workflow definition and service logs for issues.
  • No outputs found: If the workflow completes successfully but no outputs are returned, verify the workflow produces outputs correctly.
  • API key authentication: If using API keys, ensure the key is valid and has sufficient permissions.

Links and References


This summary is based solely on static analysis of the provided source code and property definitions.

Discussion