n8n

How to Generate PIAPI Video Content for Marketing?

Create short marketing videos from AI images without manual editing. Teams can turn front and side product views into a finished clip that is ready for ads, social posts, or demos. This is useful for marketers, content teams, and ecommerce stores that need fresh video fast.

The flow starts with a manual run, loads your API key, and calls PIAPI to produce two images a front view and a side view. Code steps read the streamed response and pick the latest image links. Status checks loop until both images are ready. Then the system sends a job to the PIAPI task API using the Kling model to build a video. A wait step and a poll step track progress. When done, the output is a video link plus a watermark free link.

Set up needs a PIAPI account and an API key. Add the key once in the Basic Params step and make sure every HTTP request uses the same key. Expect a first draft video in minutes, not hours. Great fit for product ads, quick explainers, and social teasers. For best results, tune the prompts in the image steps and adjust the wait timing to match your account speed.

What are the key features?

  • Manual start to control when video creation runs
  • AI image creation for front and side views via PIAPI chat completions
  • Stream parser extracts the latest image URLs from chunked data
  • Status checks loop until both images are ready
  • Video job creation with the Kling model and custom parameters
  • Wait and poll steps track task progress until complete
  • Final output includes both video URL and watermark free URL

What are the benefits?

  • Reduce manual video prep from 2 hours to 5 minutes
  • Generate product clips on demand for ads and social
  • Cut handoff time between design and marketing teams
  • Produce consistent visuals using front and side views
  • Lower costs by replacing manual editing with automation

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. See the Tools Required section above for links to create accounts with these services.
  3. In your PIAPI account, create an API key and copy it. Make sure the key has access to chat completions and task endpoints.
  4. Open the Basic Params node in n8n and paste your API key into the x-api-key field. Save the node.
  5. Double click GPT 4o Generator Front View and GPT 4o Generator Side View. In the credential dropdown, click Create new credential, choose HTTP Header Auth, and set Authorization to Bearer YOUR_PIAPI_KEY. Or keep the provided header mapping that reads the key from Basic Params.
  6. Open Generate Kling Video and confirm the header x-api-key uses the value from Basic Params. Do the same for Get Kling Video and remove any hardcoded key so it also reads from Basic Params or a shared credential.
  7. Review the prompts and message content in both GPT 4o generator nodes. Adjust the text so the images match your brand and product style.
  8. Set the Wait for Video Generation delay to match your expected render time. Longer videos may need a longer wait between polls.
  9. Click Test workflow to run it. Watch the execution. Confirm that image URLs are extracted in the two code nodes and that Verify steps turn true before the video task starts.
  10. If you get 401 errors, recheck the API key and headers. If image URLs are empty, adjust the stream parsing code or reduce the prompt complexity so the API returns images reliably.
  11. When video_url and watermark free_url appear in the final node output, store them or forward them to your media library as a next step.

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

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.