n8n

How to Generate PiAPI Canvas Marketing Graphics?

Create on brand social graphics in minutes. The build writes a short message, generates an image, and lays everything out in a ready to post design. It suits marketers and social teams who need fresh visuals fast without a full design cycle.

Here is how it runs. You start it manually and set basic fields like theme, scenario, style, example, image prompt, and your API key. A chat model call through PiAPI writes the copy. A code step merges that copy into an image prompt. A Midjourney task is created via PiAPI, then a wait step pauses until the image is ready. The flow checks task status and, when complete, pulls the image URL. Finally, a Canvas API call places the text and the image into a fixed template and returns a ready to share graphic.

Setup is simple. Add your PiAPI key and your Switchboard Canvas API key, and replace the sample key in the Canvas node. Pick the template name and confirm the text and image fields map as expected. Most teams will cut design time from hours to minutes while keeping a consistent look. Great for quote posts, product teasers, story cards, and wallpapers that match a set style.

What are the key features?

  • Manual start with a Basic Params step to set theme, scenario, style, example, image prompt, and API key.
  • LLM call through PiAPI to write short, on topic copy for the design.
  • Code node builds the final image prompt by merging the copy into your prompt template.
  • HTTP task creation to generate an image with the Midjourney model via PiAPI.
  • Wait step holds the run while the image is being created, then checks status with HTTP and logic nodes.
  • Set node extracts the image URL when the task finishes successfully.
  • Canvas API call renders a chosen template, inserts the text and image, and returns a ready graphic.

What are the benefits?

  • Reduce manual work from 2 hours to 10 minutes
  • Automate 80% of copy and image creation
  • Improve brand consistency with a fixed template
  • Connect AI text, AI images, and layout in one flow
  • Lower errors by removing copy and paste steps

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with PiAPI and Switchboard Canvas. See the Tools Required section above for links to create accounts with these services.
  3. Open the Basic Params node and fill the fields: x-api-key with your PiAPI key, plus theme, scenario, style, example, and image_prompt. Keep the 'xxx' placeholder in image_prompt so the code step can insert the copy.
  4. In the Gpt-4o-mini API node, confirm the endpoint and model are set. Double click the node, then on the 'Credential to connect with' dropdown, click 'Create new credential' and follow the on screen instructions to add your PiAPI API key.
  5. In the Midjourney Generator node, set the x-api-key header to the same PiAPI key. If you prefer credentials, choose 'Create new credential' and store the key as an API Key credential.
  6. In the Get Midjourney Task node, ensure the x-api-key header uses the same PiAPI key so the status check can read the task.
  7. Review the Wait for Midjourney Generation node settings. Keep the wait configuration so the run pauses until the task result is available.
  8. Open the Design in Canvas node. Replace the sample X-API-Key with your Switchboard Canvas API key. Confirm the template name and the sizes match your needs.
  9. Check the elements mapping in the Canvas body. text1 should use the text from the Get Prompt node, and the image field should use the first URL from the Get Image Url node.
  10. Click Test workflow to run. Watch the execution. Confirm the Switch moves to success, the Set step shows a valid image URL, and the Canvas step returns a final image URL.
  11. If the task stays in progress, increase the wait time or retry window in the Wait node. If you see authentication errors, recheck both API keys and headers. If Canvas returns an error, verify the template name and required fields.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

PIAPI

Sign up

Free plan: $0 / mo (API access to basic APIs); Pay-as-you-go Kling video from $0.16 per 5s standard video

Switchboard Canvas

Sign up

Creator: $19 / mo, 1,000 API calls

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.