N8n Cloud → Google Drive → Windows Python runner: Queue/ACK mismatch, need minimal fix

Hello n8n Community,

I’m trying to fix an existing n8n Cloud → Google Drive → Windows Python/FFmpeg production pipeline. I would appreciate help with a minimal, safe fix rather than rebuilding the workflows.

What is already working

  • n8n successfully creates and reads back JSON files in Google Drive.

  • A Windows Task Scheduler job runs every 5 minutes.

  • The scheduled chain runs a VBS → CMD → Python queue agent.

  • The Windows scheduled task reports exit code 0x0.

  • Our separate Python Leonardo API image generator has previously generated images successfully.

The problem

The n8n queue publishing and Windows queue consumption protocols do not match.

n8n creates:

BRIDGE_PING_FREE_TEST_20261024.json

But the existing Windows consumers expect:

  • CENTRAL_QUEUE_ACTIVE.json with schema FACTORY_CENTRAL_QUEUE_TRANSPORT_V1, or

  • CENTRAL_SHEET_QUEUE_V3.json with schema SHEET_DRIVE_PC_QUEUE_V3.

These consumers audit previously generated image files and write local JSON receipts. They do not call the paid Leonardo API.

The n8n test file was saved successfully to Google Drive, but no corresponding Windows ACK was found in that folder.

The Windows scheduled log repeatedly shows:

WAIT_NO_ELIGIBLE_SCENE / NO_PAID_POST

There is also a possible batch-file control-flow issue:

if errorlevel 12 exit /b 25
if errorlevel 10 exit /b 0
exit /b 25
exit /b %errorlevel%

The last statement is unreachable. We have not changed this code.

What help we need

  1. How can we connect our existing n8n workflow to the correct Google Drive Desktop synchronized queue folder using the existing accepted JSON schema?

  2. How should we verify that the Windows consumer actually reads one test job, writes its ACK, and that n8n reads back and validates the ACK?

  3. What is the recommended minimal node-level change for this workflow?

  4. How can we achieve this without frequent n8n Cloud polling or unnecessary workflow executions?

  5. What is the safest way to test everything before enabling any paid API generation?

Safety constraints

  • No new paid Leonardo API calls during testing.

  • Do not disable the existing safety gates.

  • Do not regenerate completed images.

  • Preserve existing source files, SHA256 checks, and workflow backups.

  • Do not reinstall or overwrite the Windows scheduled task.

Our immediate goal is one successful NO-CHARGE end-to-end test:

n8n → Google Drive queue → Windows PC consumer → ACK in Google Drive → n8n ACK verification.

Only after that is confirmed will we consider connecting the existing paid image-generation engine under separate approval gates.

We can provide sanitized workflow JSON and execution logs if needed.

Thank you for your help.

I’d approach this as a queue-contract mismatch rather than a scheduling problem. Since the Windows task is running successfully but reports WAIT_NO_ELIGIBLE_SCENE / NO_PAID_POST, the next step is to verify whether the producer is writing a job in the exact format and location that the existing consumer accepts.

I’d suggest this minimal validation sequence:

  1. Confirm the consumer contract first. Inspect the existing consumer code or sanitized sample files to identify the required queue filename, schema version, mandatory fields, and Google Drive Desktop synchronized folder. Avoid creating another queue format until this is confirmed.

  2. Change only the n8n publishing step. Update the existing Google Drive file-write node to publish one uniquely identified, no-charge test job using the accepted schema and expected filename. Preserve the existing workflow and safety gates.

  3. Verify the complete handshake. Confirm that the Windows consumer reads the new job, writes an ACK containing the matching job ID and status, and that n8n reads back and validates that ACK. A successful file upload or Windows exit code 0x0 alone does not prove that the job was consumed.

  4. Make retries safe. Use a stable test job ID and explicit job states. Replaying the same job should not trigger duplicate processing, regenerate completed assets, or call Leonardo. Keep paid generation disabled during this test.

  5. Reduce unnecessary polling. First establish a reliable end-to-end handshake. Then consider event-driven notification where supported, or a conservative scheduled check with persisted job/ACK state rather than frequent full-folder scans.

One additional point: the batch file’s final exit /b %errorlevel% is unreachable after the preceding unconditional exit /b 25. I would leave that code untouched until the queue contract is verified, then review exit-code propagation separately.

I’ve been working on similar reliability patterns in an n8n + FastAPI + PostgreSQL demo, including idempotency, duplicate detection, failure recovery, and operational metrics. I’d start by checking the existing consumer’s accepted schema and folder path before changing anything else.

Portfolio: GitHub - katreshital11-commits/ai-n8n-automation: "Production-ready and test-proven n8n AI workflows, automated CRM pipelines, and custom AI Agent architectures." · GitHub

Thank you for the detailed and practical guidance.

We’ve already verified a real Windows FFmpeg render, its completion receipt, and n8n automatically creating an ACK from that real receipt.

Our next test will use one brand-new job ID to verify the full unattended chain, followed by replaying the same receipt to confirm there are no duplicate renders, ACKs, or paid API calls.

We’ll also preserve our existing workflows, add independent MP4 hash verification, and keep Leonardo batch generation disabled until a single character-reference test is approved.

Your recommendations are very helpful. Thank you!

Technical Issue Report: Leonardo AI + n8n Automated Image and Video Production Pipeline

Date: October 26, 2026
Project: Automated AI Image and Video Production for a Korean YouTube Channel
Current Status: Image generation and Google Drive delivery confirmed; character consistency and reliable end-to-end production remain unresolved.

1. Project Objective

I am building an automated content production system for a Korean YouTube channel serving audiences primarily in their 50s and 60s.

My goal is not merely to generate individual AI images.

I need a production pipeline that can consistently generate multiple scenes featuring the same character, save and validate the resulting assets, and ultimately assemble those scenes into finished videos with synchronized narration and subtitles.

The system currently uses:

  • Leonardo AI for AI image generation and Character Reference

  • n8n Cloud for API orchestration and automation

  • Google Drive for reference images, generated assets, and evidence files

  • Python and FFmpeg for video assembly and rendering

  • ChatGPT and ChatGPT Work for implementation, automation, quality assurance, and troubleshooting

The Leonardo-to-n8n integration is already operational. I do not want to rebuild the entire system from scratch.

I need the existing successful integration to produce consistent, usable visual assets and support reliable automated video production.

2. What Has Already Worked

On October 26, 2026, I successfully completed one paid image-generation workflow through n8n Cloud.

The workflow performed the following operations:

  1. Downloaded the reference image from Google Drive.

  2. Uploaded the reference image to Leonardo AI.

  3. Obtained a Leonardo reference image ID.

  4. Submitted an image-generation request containing Character Reference settings.

  5. Received a completed generation response.

  6. Retrieved one newly generated image.

  7. Uploaded the generated image to Google Drive.

  8. Uploaded an evidence JSON file to Google Drive.

The associated execution details are:

Parameter Value
Run key V15_REF_PROOF_20261026_C
Scene ID V15_REF_PROOF_NEW01
Model Leonardo Phoenix 1.0
Generation ID d7390442-a0a4-43d8-a95b-400cb47d8614
Reference init image ID 6879f6bc-d658-4c46-b6ce-1dcd47029119
Generated image ID 06ef1a8e-8ade-4a7e-b919-22375e6fac04
Reference filename V15_S03_CLEAN_REPLACEMENT.png
Reference SHA256 4be4d0fd331ee2615db223f420e62c9d68d2ec9d49810da279097e051563045c
Character Reference preprocessor 397
Reference strength Mid
Requested quantity 1
Returned quantity 1
Paid generation API calls 1
Automatic retry Disabled
Provider status COMPLETE

Both the generated image and its evidence JSON were located and retrieved successfully from Google Drive.

This demonstrates that the basic API integration and file-delivery workflow are functioning.

The principal failure is therefore not connectivity or the ability to generate an image. The failure is the quality and consistency of the generated character.

3. Critical Issue: Character Identity Is Not Preserved

The reference image features a Korean middle-aged woman with her hair pulled back and distinctive facial proportions.

However, the newly generated image depicts a woman with noticeably different visual characteristics.

The differences include:

  • Different facial outline and jaw shape

  • Noticeably different overall facial appearance

  • Changes in the eyes, nose, and mouth

  • Different hairstyle and hair volume

  • Overall identity drift significant enough that the images do not convincingly depict the same character

The two actual image files were retrieved and visually compared.

The result was marked VISUAL_HOLD — insufficient character consistency.

This makes the generated asset unsuitable for use as a continuous scene featuring the established character.

This is a critical business requirement. My videos rely on recurring characters appearing across many scenes. If the face changes between scenes, the audience will perceive different people, reducing realism and production quality.

Questions for Leonardo Technical Support

  1. Can you confirm whether the reference image was actually consumed by the generation associated with Generation ID d7390442-a0a4-43d8-a95b-400cb47d8614?

  2. Was the combination of preprocessorId: 397, initImageType: UPLOADED, and strengthType: Mid processed as intended with Leonardo Phoenix 1.0?

  3. What is the most likely reason for the identity drift: reference composition, reference strength, prompt instructions, model limitations, or some other setting?

  4. Should the original wide-scene reference be replaced or supplemented with a tightly cropped facial reference?

  5. Is High strength the appropriate next step, or is another reference mechanism recommended?

  6. Is there a more suitable Leonardo model or API configuration for generating many distinct scenes while maintaining one visually consistent character?

I need an exact, actionable configuration recommendation rather than generic advice to add phrases such as “same person” to the prompt.

4. Current API Request Structure

The n8n workflow is configured to submit Character Reference through the following payload structure:

{
  "controlnets": [
    {
      "initImageId": "<uploaded_reference_image_id>",
      "initImageType": "UPLOADED",
      "preprocessorId": 397,
      "strengthType": "Mid"
    }
  ]
}

The workflow also specifies the model ID, prompt, image dimensions, and num_images: 1.

Although the workflow configuration references the uploaded image correctly, I need a reliable way to confirm which reference settings the provider actually processed for the completed generation.

A configured request field and an independently verified provider-side reference application are not necessarily the same thing.

Please provide a method for verifying the effective reference inputs and guidance settings associated with a completed generation.

5. n8n Reliability and Evidence-Tracking Issues

Several operational issues also need to be addressed.

A. Evidence records may not reflect actual generation settings

A revised workflow candidate was created to change Character Reference strength from Mid to High.

However, its evidence-generation code still contained a hard-coded Mid value.

This creates a serious traceability problem: the stored evidence could describe settings that differ from those actually submitted.

The workflow should record the actual resolved request payload and relevant provider response data rather than duplicating configuration values in independent code.

B. Paid request duplication must be prevented

A successful generation must not be charged again because of a manual workflow restart, retry, execution interruption, or incorrectly selected queue entry.

The automation needs persistent idempotency protection that can associate:

  • A unique scene or job key

  • Its authorization state

  • The request-submitted state

  • The Leonardo Generation ID

  • The completed result and file IDs

  • The final visual QA result

A retry must never silently result in an additional paid generation for the same approved job.

C. Failed visual QA must not stall the entire production system

An individual scene that fails character consistency checks should be placed on HOLD.

Other eligible, authorized jobs should continue without creating duplicate requests or automatically accepting failed images.

The workflow needs a clear separation between technical generation completion and visual quality approval.

D. Actual storage verification is required

A successful API response alone is insufficient.

The system must verify that image assets and their associated evidence files have actually been persisted and can be retrieved from Google Drive.

File checksums and provider IDs should be preserved to establish a reliable asset history.

6. Additional Metadata Issue

The evidence JSON for the completed generation contains:

{
  "provider_status": "COMPLETE",
  "nsfw": true
}

The actual generated image depicts an ordinary Korean middle-aged woman seated indoors with a smartphone and open notebooks.

There is no obvious sexually explicit content in the visible image.

Please clarify the exact meaning of the nsfw field in this response, whether the value indicates classification or restriction, and whether it affects downstream usage or automated processing.

This field did not prevent the image from being returned and stored successfully.

7. End-to-End System Requirements

The intended production pipeline is:

Approved script and scene plan → character reference validation → scene-by-scene image generation → asset storage → quality verification → scene approval → Python/FFmpeg assembly → synchronized narration and subtitles → validated MP4 output.

The finished system must meet the following requirements:

  1. Preserve the visual identity of recurring characters across different scenes.

  2. Generate one independent image file per scene, without collage or split-screen layouts.

  3. Produce realistic Korean everyday environments and culturally appropriate characters.

  4. Detect or flag facial inconsistencies, malformed hands, unwanted text, logos, and repeated visual compositions.

  5. Prevent duplicate paid API submissions.

  6. Store and verify generated files, provider IDs, hashes, and execution evidence.

  7. Isolate failed scenes without causing indefinite workflow blockage.

  8. Minimize manual intervention for each scene.

  9. Support production of finished MP4 videos with properly synchronized audio and captions.

8. Current Constraints and Safety Requirements

The successful October 26 generation must remain preserved.

The workflow’s paid-generation authorization has been returned to false.

No additional paid generation should be triggered without explicit authorization.

A revised High-strength configuration exists as an unverified candidate, but it has not yet demonstrated improved image consistency.

Installing a modified n8n workflow is not, by itself, proof that the underlying image-quality issue has been resolved.

I want to retain the working integration and make targeted changes supported by evidence.

9. Specific Assistance Requested

I am looking for direct technical support with the following deliverables:

For Leonardo AI:

  • Diagnosis of the observed identity drift using the provided Generation ID

  • Verification of the applied Character Reference input

  • A concrete recommended API payload for higher character consistency

  • Guidance on reference image composition, cropping, strength, and model selection

  • Clarification of the nsfw: true metadata

For n8n / automation engineering:

  • A workflow implementation that records the exact effective request configuration

  • Persistent protection against duplicate paid generation

  • Reliable association of scene IDs, provider job IDs, images, and Drive asset IDs

  • Safe handling of visual QA failures

  • Continued processing of other authorized scenes without unnecessary manual intervention

  • A practical integration path from approved images to automated MP4 production

10. Expected Outcome

The objective is not another architectural proposal or a fresh installation of software that is already working.

I need an implementable fix to the real remaining problems, starting with reliable character consistency.

Once character consistency has been demonstrated on a controlled test, I intend to expand to multiple scenes and ultimately to fully assembled videos.

Please provide specific technical changes, an explanation of why they should address the observed failure, and a clear verification procedure.

I want to distinguish between three outcomes:

  1. Successful API connectivity

  2. Successful generation of visually consistent and usable images

  3. Reliable end-to-end automated video production

The first has been demonstrated. The second and third are not yet complete.

The file-name and ACK protocol mismatch is usually fixed with one shared contract: the same queue folder, a filename pattern, a status field (pending, claimed, done) and an ACK file the runner writes back that n8n polls. I can write that spec and adjust both sides with minimal changes, plus a test JSON to prove it. Happy to do it as a small fixed job. — Brian

Your follow-up says the receipt-to-ACK part already works. The remaining test is a new job, not another replay of an old receipt.

  1. Check which consumer the scheduled CMD actually starts. Use that consumer’s existing filename and schema: CENTRAL_QUEUE_ACTIVE.json / FACTORY_CENTRAL_QUEUE_TRANSPORT_V1, or the V3 pair. Copy its required fields from a known accepted file; changing the filename alone is insufficient.
  2. In a backed-up copy of the n8n publisher, change only the JSON mapping and Google Drive destination. Map the Drive folder ID to the exact folder synced on Windows. For an existing fixed-name queue, update its file ID rather than creating another file with the same name. Confirm the queue is idle before this single-job test; retain the consumer’s existing ready/claim rules.
  3. Keep paid generation disabled. Publish one new job ID referring to existing approved assets. Let the existing scheduled consumer pick it up. Check its log for that ID, then locate its actual completion receipt and synced ACK; 0x0 alone proves neither.
  4. Reuse your ACK reader. Accept completion only when the ACK belongs to that job and the output file passes the existing independent hash/media checks. Replay the same job/receipt: it must return the recorded outcome without another render, ACK creation or paid call. If deduplication is missing, stop there; a lookup followed by an insert is not a concurrency lock.

Keep the existing receipt watcher for this test. Later, an authenticated runner-to-n8n webhook can replace receipt polling while Drive remains the archive; an HTTP receipt acknowledgement is not render completion.

I cannot verify your required JSON fields, Drive-to-Windows folder mapping, exit-code meanings or deduplication from these posts. Also, if errorlevel 10 means 10 or greater, and the final exit /b is unreachable; confirm the Python exit-code contract before changing that wrapper.

Minimolo