# n8n

Connect text and media requests to workflows with explicit item mapping and result handling.

## Use the HTTP Request node

n8n's [HTTP Request documentation](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/) supports explicit methods, headers and request bodies, as well as importing cURL examples. This provides a way to connect SeedRouter APIs without assuming a dedicated SeedRouter node.

## Configure an image task

Create a Header Auth credential containing `Authorization` with the value `Bearer YOUR_SEEDROUTER_KEY`. Keep the real key in n8n's credential store. Configure an HTTP Request node with method `POST`, URL `https://api.seedrouter.ai/v1/images/generations` and a JSON body:

```json
{
  "model": "gpt-image-2",
  "prompt": "An amber glass bottle on a cream background, studio lighting",
  "size": "1024x1024",
  "quality": "low"
}
```

This request comes from the [API quickstart](https://seedrouter.ai/docs/api/quickstart). Running it creates a billable generation if it succeeds. Save the returned task `id` together with the input item's own identifier.

## Retrieve the result

Use a separate GET request to `https://api.seedrouter.ai/v1/tasks/TASK_ID` with the same authentication. Follow the [task documentation](https://seedrouter.ai/docs/api/tasks) for status and output fields. Use a wait-and-check branch while the task is processing, and stop checking at a terminal result or your chosen time limit.

Keep polling separate from submission. A delayed result should not send the same POST again. Preserve the relationship between the original item, task identifier and completed asset when processing a list.

## Check the entire workflow

Test item counts, field mapping and branches with saved sample responses before running a batch. A valid node configuration can still lose items in a loop or aggregate the wrong records. For [ticket analysis](https://seedrouter.ai/solutions/ticket-analysis), classify records individually or in controlled batches, then calculate statistics deterministically.

Record the n8n version and model used for live checks. The HTTP node reference was checked on October 12, 2026; this guide supplies the documented request pattern rather than a newly measured n8n execution result.
