# Create Flux image with PiApi: n8n workflow template

> Started by someone opening a chat with it, and works across Google Drive. It puts OpenRouter behind a retrieval step, so answers are drawn from documents...

Source: https://millionrounds.com/workflow/create-flux-image-with-piapi (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [AI assistants](https://millionrounds.com/workflows?category=AI+assistants#library)

# Create Flux image with PiApi

Started by someone opening a chat with it, and works across Google Drive. It puts OpenRouter behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 14 steps, 1 branch, 2 loops or waits: a working afternoon to understand properly.

Medium Calls a model: OpenRouter Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fcreate-flux-image-with-piapi)

**14 steps** Medium: a working afternoon

**1** Branch: places the flow splits

**2** Loops or waits

**1** Service it connects to

## The flow

Starts it 2 Model 3 Logic 4 Service 5

The steps in the order they run, from what starts it.

- 1 **When chat message received** Chat trigger *Starts it*
- 2 **OpenRouter Chat Model** Lm Chat Open Router *Model*
- 3 **Simple Memory** Memory Buffer Window *Model*
- 4 **Global Constants** Global Constants *Service*
- 5 **AI Agent** Agent *Model*
- 6 **create image** Http Request *Service*
- 7 **Loop Over Items** Split In Batches *Logic*
- 8 **get image** Http Request *Service*
- 9 **If completed** If *Logic*
- 10 **HTTP Request** Http Request *Service*
- 11 **Wait 5 sec** Wait *Logic*
- 12 **Google Drive** Google Drive *Service*
- 13 **Edit Fields** Set *Logic*
- 14 **Respond to Webhook** Respond To Webhook *Starts it*

## How it's built

- **Starts on:** Someone opening a chat with it
- **Steps:** 14, with 1 branch, 2 loops or waits
- **Size:** Medium: a working afternoon
- **Connects to:** Google Drive
- **Model:** OpenRouter
- **Retrieval:** Answers are drawn from documents you supply, not from the model alone

## Questions

What does it need to run?

An n8n account, plus your own Google Drive account, and a key for OpenRouter. You connect your own accounts after importing it; none are included.

What starts it?

It starts on someone opening a chat with it.

Does it use AI?

Yes. It calls OpenRouter. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Plan an afternoon. 14 steps is enough that you should read each one before running it.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 14 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fcreate-flux-image-with-piapi)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Google Drive](https://millionrounds.com/workflows?service=Google+Drive#library)

## Workflows like it

Also ai assistants, with the same services where possible, closest in size first.

- [**Automate client onboarding with Google Forms and OpenAI** 14 steps · calls a model · ClickUp, Gmail](https://millionrounds.com/workflow/automate-client-onboarding-with-google-forms-and-openai)
- [**Automated LinkedIn job hunter: get your best daily job matches** 14 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/automated-linkedin-job-hunter-get-your-best-daily-job-matche)
- [**Create AI travel journal stories from WhatsApp with Claude** 14 steps · calls a model · Email, Google Drive](https://millionrounds.com/workflow/create-ai-travel-journal-stories-from-whatsapp-with-claude)
- [**AI Beauty Reel Generator from Product Photos (Gemini)** 13 steps · calls a model · Google Drive](https://millionrounds.com/workflow/ai-beauty-reel-generator-from-product-photos-gemini)
- [**Answer voice queries from a webhook over Google Drive docs** 15 steps · calls a model · Google Drive, Supabase vectors](https://millionrounds.com/workflow/answer-voice-queries-from-a-webhook-over-google-drive-docs)
- [**Automate YouTube Shorts Uploads with OpenAI and Google Drive** 13 steps · calls a model · Google Drive, YouTube](https://millionrounds.com/workflow/automate-youtube-shorts-uploads-with-openai-and-google-drive)
