{ "kind": "open-flow-workflow", "version": 1, "name": "Bannerbear Template Image", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_fb82b845d6e7b71c": { "name": "Enter image template and changes", "kind": "start", "inputDefs": [ { "jsonSchema": { "type": "string", "minLength": 1, "description": "The template UID to use." }, "nullable": false, "handle": "template" }, { "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "description": "The name of the template layer to modify." }, "text": { "type": "string", "description": "Replacement text for a text layer." }, "color": { "type": "string", "description": "Color in hex format, such as #FF0000." }, "background": { "type": "string", "description": "Background color in hex format, such as #FF0000." }, "background_border_color": { "type": "string", "description": "Background border color in hex format, such as #FF0000." }, "font_family": { "type": "string", "description": "The font family to use for a text layer." }, "text_align_h": { "type": "string", "enum": [ "left", "center", "right" ], "description": "Horizontal text alignment." }, "text_align_v": { "type": "string", "enum": [ "top", "center", "bottom" ], "description": "Vertical text alignment." }, "font_family_2": { "type": "string", "description": "The secondary font family to use for a text layer." }, "color_2": { "type": "string", "description": "The secondary font color in hex format." }, "image_url": { "type": "string", "format": "uri", "description": "Public image URL to use for an image layer." }, "effect": { "type": "string", "description": "The Bannerbear image effect to apply." }, "anchor_x": { "type": "string", "enum": [ "left", "center", "right" ], "description": "Horizontal image anchor point." }, "anchor_y": { "type": "string", "enum": [ "top", "center", "bottom" ], "description": "Vertical image anchor point." }, "fill_type": { "type": "string", "enum": [ "fill", "fit" ], "description": "Image fill mode." }, "disable_face_detect": { "type": "boolean", "description": "Whether to disable face detection for this image layer." }, "disable_smart_crop": { "type": "boolean", "description": "Whether to disable smart crop for this image layer." }, "chart_data": { "type": "string", "description": "Comma-delimited chart data values for chart layers." }, "rating": { "type": "integer", "minimum": 0, "maximum": 100, "description": "Star rating value from 0 to 100." }, "target": { "type": "string", "description": "QR code target URL or text." }, "bar_code_data": { "type": "string", "description": "Text to encode as a bar code." }, "gradient": { "type": "array", "items": { "type": "string", "description": "One color value." }, "minItems": 1, "description": "Gradient colors, such as #000 and #FFF." }, "shadow": { "type": "string", "description": "Layer shadow setting, such as 5px 5px 0 #000." } }, "required": [ "name" ], "additionalProperties": true, "description": "One Bannerbear template modification." }, "minItems": 1, "description": "Template layer modifications to apply." }, "nullable": false, "handle": "modifications" } ] }, "n_b5a33db7bb3f3775": { "inputs": { "template": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_fb82b845d6e7b71c", "output": "template" } ] }, "modifications": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_fb82b845d6e7b71c", "output": "modifications" } ] } }, "name": "Render Bannerbear image", "kind": "task", "task": { "inputs": [ { "description": "The template UID to use.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The template UID to use." }, "nullable": false, "handle": "template" }, { "description": "Template layer modifications to apply.", "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "description": "The name of the template layer to modify." }, "text": { "type": "string", "description": "Replacement text for a text layer." }, "color": { "type": "string", "description": "Color in hex format, such as #FF0000." }, "background": { "type": "string", "description": "Background color in hex format, such as #FF0000." }, "background_border_color": { "type": "string", "description": "Background border color in hex format, such as #FF0000." }, "font_family": { "type": "string", "description": "The font family to use for a text layer." }, "text_align_h": { "type": "string", "enum": [ "left", "center", "right" ], "description": "Horizontal text alignment." }, "text_align_v": { "type": "string", "enum": [ "top", "center", "bottom" ], "description": "Vertical text alignment." }, "font_family_2": { "type": "string", "description": "The secondary font family to use for a text layer." }, "color_2": { "type": "string", "description": "The secondary font color in hex format." }, "image_url": { "type": "string", "format": "uri", "description": "Public image URL to use for an image layer." }, "effect": { "type": "string", "description": "The Bannerbear image effect to apply." }, "anchor_x": { "type": "string", "enum": [ "left", "center", "right" ], "description": "Horizontal image anchor point." }, "anchor_y": { "type": "string", "enum": [ "top", "center", "bottom" ], "description": "Vertical image anchor point." }, "fill_type": { "type": "string", "enum": [ "fill", "fit" ], "description": "Image fill mode." }, "disable_face_detect": { "type": "boolean", "description": "Whether to disable face detection for this image layer." }, "disable_smart_crop": { "type": "boolean", "description": "Whether to disable smart crop for this image layer." }, "chart_data": { "type": "string", "description": "Comma-delimited chart data values for chart layers." }, "rating": { "type": "integer", "minimum": 0, "maximum": 100, "description": "Star rating value from 0 to 100." }, "target": { "type": "string", "description": "QR code target URL or text." }, "bar_code_data": { "type": "string", "description": "Text to encode as a bar code." }, "gradient": { "type": "array", "items": { "type": "string", "description": "One color value." }, "minItems": 1, "description": "Gradient colors, such as #000 and #FFF." }, "shadow": { "type": "string", "description": "Layer shadow setting, such as 5px 5px 0 #000." } }, "required": [ "name" ], "additionalProperties": true, "description": "One Bannerbear template modification." }, "minItems": 1, "description": "Template layer modifications to apply." }, "nullable": false, "handle": "modifications" }, { "description": "Whether to render a transparent PNG.", "jsonSchema": { "type": "boolean", "description": "Whether to render a transparent PNG." }, "nullable": true, "handle": "transparent", "value": null }, { "description": "Whether to also render a PDF.", "jsonSchema": { "type": "boolean", "description": "Whether to also render a PDF." }, "nullable": true, "handle": "render_pdf", "value": null }, { "description": "Custom metadata to store with the generated image.", "jsonSchema": { "type": "string", "description": "Custom metadata to store with the generated image." }, "nullable": true, "handle": "metadata", "value": null }, { "description": "The Bannerbear project UID. Required when using a Full Access Master API Key.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The Bannerbear project UID. Required when using a Full Access Master API Key." }, "nullable": true, "handle": "project_id", "value": null } ], "outputs": [ { "description": "One Bannerbear image.", "jsonSchema": { "type": "object", "properties": { "uid": { "type": "string", "description": "The unique image UID." }, "status": { "type": "string", "description": "The current image status, such as pending, completed, or failed." }, "self": { "type": "string", "format": "uri", "description": "The API URL for this image." }, "image_url": { "type": [ "string", "null" ], "format": "uri", "description": "The generated media URL." }, "pdf_url": { "type": [ "string", "null" ], "format": "uri", "description": "The generated media URL." }, "template": { "type": "string", "description": "The template UID used to create the image." }, "width": { "type": "integer", "description": "The rendered image width in pixels." }, "height": { "type": "integer", "description": "The rendered image height in pixels." }, "metadata": { "type": [ "string", "null" ], "description": "Custom metadata stored with the image." }, "created_at": { "type": "string", "description": "The image creation timestamp." }, "render_pdf": { "type": "boolean", "description": "Whether PDF rendering was requested." }, "transparent": { "type": "boolean", "description": "Whether transparent background rendering was requested." }, "webhook_url": { "type": [ "string", "null" ], "format": "uri", "description": "The webhook URL notified on completion." }, "webhook_response_code": { "type": [ "integer", "null" ], "description": "The HTTP status code returned by the webhook endpoint." }, "modifications": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "The layer name." } }, "additionalProperties": true, "description": "One modification returned by Bannerbear." }, "description": "The modifications applied to the template." } }, "additionalProperties": true, "description": "One Bannerbear image." }, "nullable": false, "handle": "image" } ], "name": "Render Bannerbear image", "executor": { "kind": "connector", "action": "bannerbear.create_image_sync" } } }, "n_3843161cb67b4a90": { "inputs": { "image": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_b5a33db7bb3f3775", "output": "image" } ] } }, "name": "Confirm completed image", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "properties": { "uid": { "type": "string", "description": "The unique image UID." }, "status": { "type": "string", "description": "The current image status, such as pending, completed, or failed." }, "self": { "type": "string", "format": "uri", "description": "The API URL for this image." }, "image_url": { "type": [ "string", "null" ], "format": "uri", "description": "The generated media URL." }, "pdf_url": { "type": [ "string", "null" ], "format": "uri", "description": "The generated media URL." }, "template": { "type": "string", "description": "The template UID used to create the image." }, "width": { "type": "integer", "description": "The rendered image width in pixels." }, "height": { "type": "integer", "description": "The rendered image height in pixels." }, "metadata": { "type": [ "string", "null" ], "description": "Custom metadata stored with the image." }, "created_at": { "type": "string", "description": "The image creation timestamp." }, "render_pdf": { "type": "boolean", "description": "Whether PDF rendering was requested." }, "transparent": { "type": "boolean", "description": "Whether transparent background rendering was requested." }, "webhook_url": { "type": [ "string", "null" ], "format": "uri", "description": "The webhook URL notified on completion." }, "webhook_response_code": { "type": [ "integer", "null" ], "description": "The HTTP status code returned by the webhook endpoint." }, "modifications": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "The layer name." } }, "additionalProperties": true, "description": "One modification returned by Bannerbear." }, "description": "The modifications applied to the template." } }, "additionalProperties": true, "description": "One Bannerbear image." }, "nullable": false, "handle": "image" } ], "outputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "image" } ], "name": "Confirm completed image", "moduleId": "n_ec4019825417e3bd", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_6a2326c2938330a0": { "name": "Completed template image", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "image" } ], "outputMappings": { "image": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_3843161cb67b4a90", "output": "image" } ] } } } }, "edges": [ { "source": "n_fb82b845d6e7b71c", "target": "n_b5a33db7bb3f3775" }, { "source": "n_b5a33db7bb3f3775", "target": "n_3843161cb67b4a90" }, { "source": "n_3843161cb67b4a90", "target": "n_6a2326c2938330a0" } ] } }, "modules": { "n_ec4019825417e3bd": { "name": "Confirm completed image", "imports": [], "source": "function readBannerbearImage(image) {\n if (!image || typeof image !== 'object' || Array.isArray(image) || image.status !== 'completed' || typeof image.uid !== 'string' || !image.uid.trim() || typeof image.image_url !== 'string' || !image.image_url.trim()) {\n throw new Error('Bannerbear did not return a completed image with a UID and media URL');\n }\n return image;\n}\nexport default async function bannerbearResult({ image }) {\n return { image: readBannerbearImage(image) };\n}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }