-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkflow.json
More file actions
70 lines (70 loc) · 1.88 KB
/
workflow.json
File metadata and controls
70 lines (70 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
"name": "webhook-handler",
"description": "Log an incoming webhook event and forward to a destination API with retry.",
"category": "integration",
"features": ["crypto", "http"],
"input_schema": {
"type": "object",
"required": ["payload", "destination_url"],
"properties": {
"payload": {
"type": "object",
"description": "The incoming webhook payload to process"
},
"destination_url": {
"type": "string",
"description": "Destination API URL to forward the transformed payload to"
},
"expected_source": {
"type": "string",
"description": "Expected source identifier for validation"
}
}
},
"definition": {
"timeout": "2m",
"on_timeout": "fail",
"steps": [
{
"id": "hash-payload",
"type": "action",
"action": "crypto.hash",
"params": {
"algorithm": "sha256",
"data": "${{inputs.payload.event}}"
}
},
{
"id": "log-event",
"type": "action",
"action": "workflow.log",
"depends_on": ["hash-payload"],
"params": {
"message": "Webhook payload received, forwarding to destination",
"event": "${{inputs.payload.event}}",
"destination": "${{inputs.destination_url}}",
"payload_hash": "${{steps.hash-payload.output.hash}}"
}
},
{
"id": "forward",
"type": "action",
"action": "http.post",
"depends_on": ["log-event"],
"params": {
"url": "${{inputs.destination_url}}",
"body": {
"event": "${{inputs.payload.event}}",
"payload_hash": "${{steps.hash-payload.output.hash}}"
}
},
"timeout": "30s",
"retry": {
"max": 3,
"backoff": "exponential",
"delay": "2s"
}
}
]
}
}