feat(trigger): enhance trigger plugin data structure and error handling

- Added `plugin_unique_identifier` to `PluginTriggerData` and `TriggerProviderApiEntity` to improve identification of trigger plugins.
- Introduced `PluginTriggerDispatchData` for structured dispatch data in Celery tasks, enhancing the clarity of trigger dispatching.
- Updated `dispatch_triggered_workflows_async` to utilize the new dispatch data structure, improving error handling and logging for trigger invocations.
- Enhanced metadata handling in `TriggerPluginNode` to include trigger information, aiding in debugging and tracking.

These changes improve the robustness and maintainability of trigger plugin interactions within the workflow system.
This commit is contained in:
Harry
2025-09-16 15:39:40 +08:00
parent ee68a685a7
commit 0cb0cea167
9 changed files with 81 additions and 25 deletions

View File

@ -66,6 +66,7 @@ const TriggerPluginActionItem: FC<Props> = ({
trigger_name: payload.name,
trigger_label: payload.label[language],
trigger_description: payload.description[language],
plugin_unique_identifier: provider.plugin_unique_identifier,
title: payload.label[language],
is_team_authorization: provider.is_team_authorization,
output_schema: payload.output_schema || {},

View File

@ -35,11 +35,12 @@ export type TriggerDefaultValue = PluginDefaultValue & {
trigger_label: string
trigger_description: string
title: string
plugin_unique_identifier: string
is_team_authorization: boolean
params: Record<string, any>
paramSchemas: Record<string, any>[]
output_schema: Record<string, any>
credential_id?: string
subscription_id?: string
meta?: PluginMeta
}
@ -149,7 +150,7 @@ export type TriggerProviderApiEntity = {
icon_dark?: string
tags: string[]
plugin_id?: string
plugin_unique_identifier?: string
plugin_unique_identifier: string
credentials_schema: TriggerCredentialField[]
oauth_client_schema: TriggerCredentialField[]
subscription_schema: TriggerSubscriptionSchema
@ -160,6 +161,7 @@ export type TriggerProviderApiEntity = {
export type TriggerWithProvider = Collection & {
triggers: Trigger[]
meta: PluginMeta
plugin_unique_identifier: string
credentials_schema?: TriggerCredentialField[]
oauth_client_schema?: TriggerCredentialField[]
subscription_schema?: TriggerSubscriptionSchema