How to create a custom node that its timer or cronjob doesn't block the workflow

I want to create. a custom node that it can set certain time to executive but it will not prevent the next node to executive. I used two methods, CronJob and setTimeout, but it will hold the workflow until it complete. Is there a solution to resolve this?

this is the node config in editor ui:


this is how the workflow execute:

this is my code with cronJob:

const cronJobs: CronJob[] = [];
for (const cronTime of cronTimes) {
	const index:number = cronTimes.indexOf(cronTime)
	cronJobs.push(new CronJob(cronTime, () => executeTrigger(index), undefined, true, timezone));
}

this is my code with setTimeout

for (const cronTime of cronTimes) {
		const index:number = cronTimes.indexOf(cronTime)
		setTimeout(() => {
				executeTrigger(index)
		}, cronTime)
}

I use this.emit, it seems it can stop the node

this.emit([this.helpers.returnJsonArray([returnData])]);

But I just want the workflow to go ahead without waiting the timer or cronjob complete.

Hi @vanessa, this seems like a duplicate of the question in How to create a custom node which has a waiting function but not prevent the workflow execute - #3 by vanessa where @jan has confirmed that having the workflow go ahead isn’t currently possible unfortunately.

Thanks MutedJam. I had discussed with my colleague about this question, maybe we don’t really understand n8n before. You’ve told me that n8n is not designed to handle asynchronous events.