Receiving service task to nodejs

Hi there, first time working with Camunda and BPMN in general so please bear with me!

I have Camunda community installed locally via Docker container.

I’ve deployed a simple model which checks if some documents have been received and then creates a user task for a person to check over said documents. If not enough documents have been received this should then call a service task.

process.bpmn (8.7 KB)

The service task is a nodejs script which calls a REST api to send an email. This is also running in a Docker container locally.

const { Client, logger } = require('camunda-external-task-client-js');
const http = require("http");

const config = { baseUrl: 'http://tif-camunda:8080/engine-rest', use: logger, asyncResponseTimeout: 10000 };

// create a Client instance with custom configuration
const client = new Client(config);

console.log('Starting email document reminder polling service');

client.subscribe('email-document-reminder', async function({ task, taskService }) {
    
    // api calls here

    await taskService.complete(task);
}

The standard out from the nodejs script show that is subscribed to the service task topic ok.

Output from the script:
Starting email document reminder polling service
✓ subscribed to topic email-document-reminder

However, when the process hits this task, it does not seem to fire to it.
In Cockpit the token is just sitting at the service task and never moves or fails.

There must be something I’m missing. Any pointers would be greatly appreciated.

Thank you,
Rob

Please delete this thread.

There was an error in my script which was causing this. A simple syntax issue which I found when I ran the script without the Camunda parts.

Thank you,
Rob

Thanks for letting us know you found a solution