How to use the n8n-core.createDeferredPromise function in n8n-core

To help you get started, we’ve selected a few n8n-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github n8n-io / n8n / packages / cli / src / ActiveExecutions.ts View on Github external
async getPostExecutePromise(executionId: string): Promise {
		// Create the promise which will be resolved when the execution finished
		const waitPromise = await createDeferredPromise();

		if (this.activeExecutions[executionId] === undefined) {
			throw new Error(`There is no active execution with id "${executionId}".`);
		}

		this.activeExecutions[executionId].postExecutePromises.push(waitPromise);

		return waitPromise.promise();
	}