Orshot icon

Orshot

Automated Image Generation for Marketing

Overview

This node integrates with the Orshot API to generate images based on predefined templates, specifically supporting generation from Orshot Studio templates. It allows users to select a studio template and apply custom modifications to dynamically render images in various formats and response types.

Common scenarios include:

  • Automating marketing image creation by programmatically rendering customized visuals.
  • Generating social media graphics or promotional banners with dynamic text or elements.
  • Creating PDF or WebP assets on-demand for campaigns or reports.

For example, a user can select a studio template for a product promotion, modify the product name and price via the node’s input properties, and receive a rendered PNG image either as base64 data, binary file, or a URL.

Properties

Name Meaning
Template Name or ID Select the Orshot Studio template to render from. Choose from a dropdown list loaded dynamically or specify an ID using an expression.
Response Type The format in which the rendered image is returned:
- Base64: Encoded string of the image data.
- Binary: Raw binary data suitable for file handling.
- URL: A direct URL to the rendered image.
Response Format The output format of the rendered image. Options include: JPEG, JPG, PDF, PNG, and WebP.
Modifications A collection of key-value pairs representing template modifications. Each modification corresponds to a specific editable element in the selected template (e.g., text fields, colors). Users select keys from a list and provide values.

Output

The node outputs JSON data containing metadata about the rendered image along with the image data itself depending on the chosen response type:

  • json object fields:

    • templateId: The ID of the selected studio template.
    • responseType: The chosen response type (base64, binary, or url).
    • responseFormat: The image format used for rendering.
    • statusCode: HTTP status code from the API response.
    • modifications: Object listing all applied modifications as key-value pairs.
    • data: Contains the actual image data or URL depending on responseType:
      • For base64, this is a base64-encoded string of the image.
      • For url, this is the URL string pointing to the rendered image.
      • For binary, the image is provided as binary data attached under the binary property named data.
  • If responseType is binary, the node attaches the image as binary data with the appropriate MIME type inferred from the format (e.g., image/png).

Dependencies

  • Requires an API key credential for authenticating requests to the Orshot API.
  • The node makes HTTP POST requests to the Orshot Studio render endpoint (https://api.orshot.com/v1/studio/render).
  • Requires n8n environment configured with the Orshot API credentials.
  • Uses internal helper methods for authenticated HTTP requests and binary data preparation.

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Selecting a non-existent or invalid template ID will result in API errors.
    • Providing incorrect modification keys or values may cause rendering errors or unexpected results.
    • Network connectivity issues can lead to request timeouts or failures.
  • Error messages:

    • "API request failed with status XXX" indicates the API responded with an error status code. The message often includes details from the API error response.
    • "Failed to load studio templates" occurs if the node cannot fetch available templates, possibly due to authentication or network problems.
    • "Unknown error occurred" is a generic fallback when the error cannot be parsed.
  • Resolutions:

    • Verify that the API key credential is correctly set up and has necessary permissions.
    • Ensure the selected template ID exists and is accessible.
    • Double-check modification keys against the available options for the chosen template.
    • Test network connectivity and retry if transient errors occur.
    • Enable "Continue On Fail" in the node settings to handle errors gracefully during batch processing.

Links and References

Discussion