← Duply blog

Workflow automation

How to Build an n8n Image Automation Workflow

n8n is useful for image automation when a simple one-trigger, one-action recipe is not enough. It gives you explicit control over data shaping, branches, retries, credentials, and the systems that receive the finished image.

· 8 minute read

Start with the workflow contract

Write down five things before adding nodes: the triggering event, required fields, approved template, expected output, and destination. This prevents a visually impressive demo from becoming an unreliable production workflow.

Use stable internal field names such as headline, source_image_url, price, and record_id. Do not map directly from labels that editors can rename without warning.

  • Trigger and source record ID
  • Required and optional fields
  • Template ID and allowed dynamic layers
  • Output URL destination
  • Owner for validation failures

A practical n8n node sequence

A typical workflow starts with a webhook, schedule, or application node. A Set or Code node then normalizes values before an IF node rejects incomplete records. The HTTP Request node calls Duply, and a final branch writes the result or error back to the source system.

Keep API credentials in n8n credentials rather than inside node JSON. Send only the values required by the chosen template and retain the source record ID with the result.

  • Trigger node
  • Normalize and validate
  • HTTP Request to Duply
  • Success and error branches
  • Write result back to source

Design retries around the type of failure

Temporary network failures can be retried with a delay. Invalid data should not be retried unchanged. Route missing fields, unreachable source images, and text-length violations to a review queue with a clear error message.

Use an idempotency value derived from the source event or record version. That keeps a retried workflow from silently creating duplicate outputs.

Test the workflow with edge cases

Test the longest headline, smallest photo, missing optional field, expired URL, duplicate event, and an API timeout. Confirm that every case either creates the expected image or produces a visible, actionable failure.

Once the flow is stable, add observability: execution labels, source IDs, generation IDs, timing, and a simple alert for repeated failures.

Frequently asked questions

Do I need a custom n8n node for Duply?

No. Use an authenticated HTTP Request node and map fields from earlier workflow steps.

Should the workflow wait for image generation?

That depends on the surrounding system. For webhook senders with short timeouts, acknowledge first and continue asynchronously.