701 workflow improve webhook triggers (#11455)
as title Nota bene: I did not filter execution by http method. A POST webhook trigger can be triggered by a GET request for more flexibility. Tell me if you think it is a mistake https://github.com/user-attachments/assets/1833cbea-51a8-4772-bcd8-088d6a087e79
This commit is contained in:
@ -209,9 +209,19 @@ export const workflowCronTriggerSchema = baseTriggerSchema.extend({
|
||||
|
||||
export const workflowWebhookTriggerSchema = baseTriggerSchema.extend({
|
||||
type: z.literal('WEBHOOK'),
|
||||
settings: z.object({
|
||||
outputSchema: z.object({}).passthrough(),
|
||||
}),
|
||||
settings: z.discriminatedUnion('httpMethod', [
|
||||
z.object({
|
||||
outputSchema: z.object({}).passthrough(),
|
||||
httpMethod: z.literal('GET'),
|
||||
authentication: z.literal('API_KEY').nullable(),
|
||||
}),
|
||||
z.object({
|
||||
outputSchema: z.object({}).passthrough(),
|
||||
httpMethod: z.literal('POST'),
|
||||
expectedBody: z.object({}).passthrough(),
|
||||
authentication: z.literal('API_KEY').nullable(),
|
||||
}),
|
||||
]),
|
||||
});
|
||||
|
||||
// Combined trigger schema
|
||||
|
||||
Reference in New Issue
Block a user