Skip to content

PDF Export Workflow

A PDF export is a synchronous workflow that starts from a webhook event, writes a file with action/export, and returns that file with action/viewFile.

{
"identifier": "ExamplePdfExport",
"title": "Export example as PDF",
"async": false,
"entry": "onExportPdf",
"elements": [
{
"name": "onExportPdf",
"type": "event/webhook",
"options": {
"module": "example_module",
"title": "Als PDF exportieren",
"show_in_button_bar": false
},
"to": {
"default": {
"exportPdf": ["default"]
}
}
},
{
"name": "exportPdf",
"type": "action/export",
"options": {
"type": "pdf",
"filename": "example.pdf",
"content": "example_pdf_content",
"store_module": "files",
"view_module": "views"
},
"to": {
"default": {
"viewPdf": ["default"]
}
}
},
{
"name": "viewPdf",
"type": "action/viewFile"
}
],
"events": [
{
"identifier": "onExportPdf",
"type": "webhook",
"module": "example_module",
"title": "Als PDF exportieren",
"show_in_button_bar": false
}
]
}

The content, header, and footer options reference Brezel views. Create or reuse those views before the workflow is expected to render successfully.

Use view_data or export options when the template needs derived values. Keep filenames deterministic enough for users to understand them, but avoid unsafe clear-name overwrites unless the system explicitly needs them.

  • Add a UI trigger with the buttons component or show_in_button_bar.
  • Create the workflow with async: false, because action/viewFile returns an HTTP response.
  • Check the current event/webhook, action/export, and action/viewFile element specs before writing the workflow.
  • Add or reuse required views/templates in the same draft if they do not exist yet.
  • Refresh the preview only after the button, workflow, and required view references are in place.