Implementing execution listener in a worker

Hello,

The documentation states that an execution listener are processed by job workers. However I can’t find any example.
I have defined this basic job handler:

import 'dotenv/config';
import { Camunda8 } from '@camunda8/sdk';
import { ZeebeJob } from '@camunda8/sdk/dist/zeebe/types';

const c8 = new Camunda8();
const zeebe = c8.getZeebeGrpcApiClient();

async function jobHandler(job: ZeebeJob) {
  const currentTime = new Date().toISOString();
  console.log(`Job called at ${currentTime}`);
  return job.complete();
}

zeebe.createWorker({
  taskType: 'local-handler',
  taskHandler: jobHandler,
});

I can successfully get this triggered as a service task; but I’d like to get it triggered as either an execution listener or task listener. I don’t see anything in the task “execution listener” options that are early made for that.

What am I missing?

Hi @adrienfff

I believe that the diagram created in your case is a Camunda 7 diagram.
Please always ensure that you create a Camunda 8 diagram and the execution platform is set to 8.6 or above

1 Like

Yes that was it, thank you.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.