mirror of
https://github.com/n8n-io/n8n.git
synced 2026-06-04 18:49:20 +02:00
Some checks are pending
CI: Master (Build, Test, Lint) / Build for Github Cache (push) Waiting to run
CI: Master (Build, Test, Lint) / Unit tests (22.x) (push) Waiting to run
CI: Master (Build, Test, Lint) / Unit tests (24.15.0) (push) Waiting to run
CI: Master (Build, Test, Lint) / Lint (push) Waiting to run
CI: Master (Build, Test, Lint) / Performance (push) Waiting to run
CI: Master (Build, Test, Lint) / Notify Slack on failure (push) Blocked by required conditions
20 lines
510 B
TypeScript
20 lines
510 B
TypeScript
import { TagRepository } from '@n8n/db';
|
|
import { Service } from '@n8n/di';
|
|
|
|
/**
|
|
* Exposes methods for common helpers to use in workflow lifecycle hooks.
|
|
*/
|
|
@Service()
|
|
export class WorkflowHookContextService {
|
|
constructor(private readonly tagRepository: TagRepository) {}
|
|
|
|
async getWorkflowTags(workflowId: string): Promise<string[]> {
|
|
const tags = await this.tagRepository.find({
|
|
where: { workflows: { id: workflowId } },
|
|
select: { name: true },
|
|
});
|
|
|
|
return tags.map(({ name }) => name);
|
|
}
|
|
}
|