Hi Leanne, thanks for that, I find that interesting as im using LLMS Chat gpt 5 which can output those file tyres on the fly, so was thinking maybe using an action or summary card to mayb upload and then inject.
// actions/makeDocx.ts
import { Document, Packer, Paragraph, TextRun } from "docx";
export default async ({ title, body }: { title: string; body: string }, { client }) => {
// Build a simple DOCX in-memory
const doc = new Document({
sections: [
{
children: [
new Paragraph({ children: [new TextRun({ text: title, bold: true, size: 32 })] }),
new Paragraph(body),
],
},
],
});
const buffer = await Packer.toBuffer(doc); // <- Buffer of the .docx
// Upload to Botpress Files (make it public so you can share the link)
const file = await client.uploadFile({
key:
exports/${Date.now()}.docx
,
content: buffer,
accessPolicies: ["public_content"], // permanent public URL
});
// Return the URL so the workflow can send it to the user
return { url: file.url };
};