/
individual_updates.json
182 lines (182 loc) · 5.2 KB
/
individual_updates.json
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
{
"name": "individual_updates",
"description": "This workflow is used to get scrum update for user",
"version": 2,
"tasks": [
{
"name": "send_welcome_message",
"taskReferenceName": "send_welcome_message",
"inputParameters": {
"user_name": "${workflow.input.user_name}",
"http_request": {
"uri": "https://slack.com/api/chat.postMessage",
"method": "POST",
"connectionTimeOut": 3000,
"readTimeOut": 3000,
"body": {
"channel": "${workflow.input.user_id}",
"text": "Hello *${workflow.input.user_name}*! Good Morning. What is your scrum update for today. Send *done* to end update",
"as_user": true
},
"headers": {
"Authorization": "Bearer ${workflow.secrets.slack_standup_token}"
}
}
},
"type": "HTTP",
"decisionCases": {},
"defaultCase": [],
"forkTasks": [],
"startDelay": 0,
"joinOn": [],
"optional": false,
"defaultExclusiveJoinTask": [],
"asyncComplete": false,
"loopOver": [],
"onStateChange": {}
},
{
"name": "loopTask",
"taskReferenceName": "loopTask",
"inputParameters": {
"value": "${workflow.input.loop}"
},
"type": "DO_WHILE",
"decisionCases": {},
"defaultCase": [],
"forkTasks": [],
"startDelay": 0,
"joinOn": [],
"optional": false,
"defaultExclusiveJoinTask": [],
"asyncComplete": false,
"loopCondition": "if ($.webhook_task['event']['text'] == \"done\" ) { false;} else {true;} ",
"loopOver": [
{
"name": "webhook_task",
"taskReferenceName": "webhook_task",
"inputParameters": {
"user_id": "${workflow.input.user_id}",
"matches": {
"$['event']['type']": "message",
"$['event']['user']": "${workflow.input.user_id}"
}
},
"type": "WAIT_FOR_WEBHOOK",
"decisionCases": {},
"defaultCase": [],
"forkTasks": [],
"startDelay": 0,
"joinOn": [],
"optional": false,
"defaultExclusiveJoinTask": [],
"asyncComplete": false,
"loopOver": [],
"onStateChange": {}
}
],
"onStateChange": {}
},
{
"name": "jq_aggregate_updates",
"taskReferenceName": "jq_aggregate_updates",
"inputParameters": {
"updates": "${loopTask.output}",
"queryExpression": ".updates | to_entries | .[] | select(.key != \"iteration\") | .value | .webhook_task.event.text | select(. != \"done\") | select (. | startswith(\"Hello\") | not)"
},
"type": "JSON_JQ_TRANSFORM",
"decisionCases": {},
"defaultCase": [],
"forkTasks": [],
"startDelay": 0,
"joinOn": [],
"optional": false,
"defaultExclusiveJoinTask": [],
"asyncComplete": false,
"loopOver": [],
"onStateChange": {}
},
{
"name": "jq_convert_to_string",
"taskReferenceName": "jq_convert_to_string",
"inputParameters": {
"updates": "${jq_aggregate_updates.output.resultList}",
"queryExpression": ".updates | join(\",\")"
},
"type": "JSON_JQ_TRANSFORM",
"decisionCases": {},
"defaultCase": [],
"forkTasks": [],
"startDelay": 0,
"joinOn": [],
"optional": false,
"defaultExclusiveJoinTask": [],
"asyncComplete": false,
"loopOver": [],
"onStateChange": {}
},
{
"name": "append_user_name",
"taskReferenceName": "append_user_name",
"inputParameters": {
"user_name": "${workflow.input.user_name}",
"updates": "${jq_convert_to_string.output}",
"queryExpression": "(.user_name + \"'s update - \" + .updates.result)"
},
"type": "JSON_JQ_TRANSFORM",
"decisionCases": {},
"defaultCase": [],
"forkTasks": [],
"startDelay": 0,
"joinOn": [],
"optional": false,
"defaultExclusiveJoinTask": [],
"asyncComplete": false,
"loopOver": [],
"onStateChange": {}
},
{
"name": "post_updates",
"taskReferenceName": "post_updates",
"inputParameters": {
"http_request": {
"uri": "${workflow.secrets.slack_conductor_channel_url}",
"method": "POST",
"connectionTimeOut": 3000,
"readTimeOut": 3000,
"body": {
"text": "${append_user_name.output.result}"
},
"headers": {
"Content-type": "application/json"
}
}
},
"type": "HTTP",
"decisionCases": {},
"defaultCase": [],
"forkTasks": [],
"startDelay": 0,
"joinOn": [],
"optional": false,
"defaultExclusiveJoinTask": [],
"asyncComplete": false,
"loopOver": [],
"onStateChange": {}
}
],
"inputParameters": [
"user_name",
"user_id"
],
"outputParameters": {},
"schemaVersion": 2,
"restartable": true,
"workflowStatusListenerEnabled": false,
"ownerEmail": "viren@orkes.io",
"timeoutPolicy": "TIME_OUT_WF",
"timeoutSeconds": 1800,
"variables": {},
"inputTemplate": {},
"onStateChange": {}
}