How it works
What this workflow does
Generate one original campaign image and a matching caption for editorial review. An authenticated webhook validates an approved brief, asks OpenAI for the caption and reviewer notes, builds a controlled image prompt, generates one PNG, uploads it to a configured Google Drive folder, and saves the caption, image link, and review notes in Google Sheets.
The workflow imports inactive with dryRun: true. Run with sample data uses a fictional campaign and sample caption, so the preview does not call OpenAI, Google Drive, Google Sheets, or the Data Table.
This is the visual-production layer for the Content Publishing, Social Distribution & Newsletter Intelligence blueprint; the Campaign Launch Assurance & Weekly Performance blueprint covers distribution and measurement.
Approved brief, controlled prompt
Validate campaign brief requires a stable request ID, campaign name, an allowed channel (LinkedIn, Instagram, or Facebook), a visual direction, the approved message, a palette, and approved: true. Image size must be one of the supported landscape, square, or portrait sizes. The default model is gpt-image-1 at 1024x1024.
The caption model may use only the approved message. It cannot add links, tag handles, pricing, results, guarantees, or unsupported claims. The workflow builds the image prompt from the approved visual direction and palette, explicitly excludes typography, lettering, watermarks, brand marks, and third-party logos, and asks for a composition that leaves room for later layout.
Paid generation with recovery
The Data Table prevents a repeat request from generating another image. A new request is reserved as asset_pending before the paid image call. The response must contain exactly one base64 PNG with a valid PNG signature and bounded size. The workflow converts it to a file named with the request ID, uploads it to the configured Drive folder, verifies the returned file ID, and records the reserved Drive ID before writing the review row.
A successful queue row contains the caption, Drive link, review notes, and Status: Needs review. The editor checks the crop, visual details, and caption against the approved brief, then adds alt text after reviewing the finished image. A live run uses a paid image API call.
Validation scope
The supplied report confirms the isolated n8n 2.47.4 import, inactive state, and sample path. It also covers structural checks, campaign approval, allowed sizes, stable filenames, PNG response checks, and file conversion. Live OpenAI, Google Drive, Google Sheets, and Data Table calls require a staging test with your accounts. Review generated assets for unintended logos, lettering, or inaccurate details before publishing.
How to use
Before you start
- A current n8n instance with Data Table support.
- An OpenAI API key with access to the chat and image-generation endpoints.
- A Google Drive folder with the correct reviewer permissions.
- A Google spreadsheet tab for the campaign asset queue.
- Google Drive and Google Sheets OAuth credentials.
- A trusted content queue or internal form.
1. Import and run the sample
Download the complete package, extract the ZIP, and read the full setup guide. Import campaign-image-and-caption.n8n.json and keep it inactive.
Open Run with sample data and choose Test workflow. Assemble campaign creative should return the sample caption, review notes, prompt, size, and filename.
2. Create the state table and sheet
Create an n8n Data Table with text columns event_key, status, detail, and result_id. Enter its ID in Setup.
Create a Google Sheets tab named Campaign Asset Queue with these exact headers:
| Request ID | Campaign | Channel | Caption | Image URL | Review Notes | Status |
|---|
Format Request ID as plain text. Select the Google Sheets OAuth credential on Save campaign asset for review.
3. Configure Drive and the image model
In Setup, set spreadsheetId, driveId, folderId, imageModel, imageSize, the caption model, and your brandVoice. Leave driveId as My Drive for a personal drive or use the shared drive ID. Choose one of the supported sizes.
Select Google Drive OAuth on Upload image to review folder.
4. Connect the model and inbound webhook
Add OpenAI bearer Header Auth credentials to Write campaign caption and Generate original PNG. Put a separate private inbound Header Auth credential on Receive event.
5. Send an approved campaign brief
POST requestId, campaignName, channel, visualDirection, approvedMessage, palette, and approved: true. Use the supplied test payloads to check the brief and expected caption. The webhook acknowledges receipt.
Unapproved briefs and invalid sizes stop before the image request. Keep one request per revision in flight; a live run uses a paid image API call.
6. Review and operate
In staging, set dryRun to false and submit a fictional campaign to generate one test image. Review the crop and check the caption against the approved message, then add alt text after reviewing the finished image.
If a run stops at asset_pending, check the stored Drive ID or look for the generated filename before retrying. Recover the caption from the failed execution if the file uploaded and the sheet write failed.
Related automations
Use the Article-to-Social Draft System for the post copy and the Video Script & Shot List System for video production. The Curated Newsletter Draft System can carry the campaign into an email issue. Read the Content Publishing & Newsletter Intelligence blueprint for the wider creative process.