Recipes

Recipe: Export Workflow

Save, export PDF, and export Instant JSON safely.

if (instance.hasUnsavedChanges()) {
  await instance.ensureChangesSaved();
}

const pdfBytes = await instance.exportPDF();
const instantJson = await instance.exportInstantJSON();

await instance.importInstantJSON(instantJson);

Notes

  • save and exportPDF are not equivalent in all workflows.
  • Prefer explicit export APIs for deterministic outputs.