Upload pdf file to processInstance form external Task

hello. i want to use a external task to upload pdf file to camunda and set it as a process variable using nodejs with help of camunda-external-task-client-js

client.subscribe("generatepdf", async function ({ task, taskService }) {
  
  const processVariables = new Variables();

  const file = await new File({
    localPath: "./assets/a.pdf",
    mimetype: "application/pdf",
  }).load();
  processVariables.set("doc", file);
  await taskService.complete(task, processVariables);
});

I already try this with no luck,
i want to upload file as pdf file to camunda variable (variable with type “File”)

Have you compared your work with the example?

The way the variables are being set are different…

Not that I’m saying that it’s the solution, but it might take you down the right path.

1 Like