-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkflow.json
More file actions
89 lines (89 loc) · 2.27 KB
/
Copy pathworkflow.json
File metadata and controls
89 lines (89 loc) · 2.27 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{
"name": "digest-builder",
"description": "Fetch content from multiple URLs, log the results, and send via email API.",
"category": "content",
"features": ["loop", "http", "on_error"],
"input_schema": {
"type": "object",
"required": ["sources", "send_api_url", "recipient"],
"properties": {
"sources": {
"type": "array",
"description": "Array of URLs to fetch content from",
"items": { "type": "string" }
},
"send_api_url": {
"type": "string",
"description": "Email/notification API endpoint to send the digest"
},
"recipient": {
"type": "string",
"description": "Recipient email or channel ID"
}
}
},
"definition": {
"timeout": "5m",
"on_timeout": "fail",
"steps": [
{
"id": "fetch-sources",
"type": "loop",
"config": {
"mode": "for_each",
"over": "inputs.sources",
"max_iter": 50,
"body": [
{
"id": "fetch-url",
"type": "action",
"action": "http.get",
"params": {
"url": "${{loop.item}}"
},
"timeout": "20s",
"retry": {
"max": 2,
"backoff": "exponential",
"delay": "1s"
},
"on_error": {
"strategy": "ignore"
}
}
]
}
},
{
"id": "log-digest",
"type": "action",
"action": "workflow.log",
"depends_on": ["fetch-sources"],
"params": {
"message": "Digest sources fetched, preparing to send",
"recipient": "${{inputs.recipient}}"
}
},
{
"id": "send-digest",
"type": "action",
"action": "http.post",
"depends_on": ["log-digest"],
"params": {
"url": "${{inputs.send_api_url}}",
"body": {
"to": "${{inputs.recipient}}",
"subject": "Daily Digest",
"message": "Digest compiled from configured sources"
}
},
"timeout": "15s",
"retry": {
"max": 2,
"backoff": "exponential",
"delay": "2s"
}
}
]
}
}