@crewx/workflow 0.3.8 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,179 +1,218 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "CrewX Workflow Schema",
4
- "description": "JSON Schema for crewx.yaml workflows section",
5
- "type": "object",
6
- "additionalProperties": {
7
- "$ref": "#/definitions/WorkflowSpec"
8
- },
9
- "definitions": {
10
- "WorkflowSpec": {
11
- "type": "object",
12
- "required": ["nodes"],
13
- "properties": {
14
- "metadata": {
15
- "$ref": "#/definitions/Metadata"
16
- },
17
- "timeout": {
18
- "type": "number"
19
- },
20
- "max_iterations": {
21
- "type": "number"
22
- },
23
- "state": {
24
- "type": "object"
25
- },
26
- "nodes": {
27
- "type": "object",
28
- "additionalProperties": {
29
- "$ref": "#/definitions/WorkflowNode"
30
- }
31
- }
32
- }
33
- },
34
- "Metadata": {
35
- "type": "object",
36
- "required": ["name"],
37
- "properties": {
38
- "name": {
39
- "type": "string"
40
- },
41
- "description": {
42
- "type": "string"
43
- },
44
- "version": {
45
- "type": "string"
46
- }
47
- }
48
- },
49
- "WorkflowNode": {
50
- "type": "object",
51
- "required": ["type"],
52
- "properties": {
53
- "type": {
54
- "type": "string",
55
- "enum": ["agent_task", "parallel", "join", "branch", "approval", "expression", "end"]
56
- },
57
- "agent": {
58
- "type": "string"
59
- },
60
- "mode": {
61
- "type": "string",
62
- "enum": ["query", "execute"]
63
- },
64
- "input": {
65
- "type": "string"
66
- },
67
- "output": {
68
- "type": "string"
69
- },
70
- "hooks": {
71
- "type": "array",
72
- "items": {
73
- "type": "string"
74
- }
75
- },
76
- "retry": {
77
- "$ref": "#/definitions/RetryConfig"
78
- },
79
- "condition": {
80
- "type": "string"
81
- },
82
- "branches": {
83
- "oneOf": [
84
- {
85
- "type": "array",
86
- "items": {
87
- "type": "string"
88
- },
89
- "description": "For parallel nodes: array of node IDs to execute concurrently"
90
- },
91
- {
92
- "type": "object",
93
- "additionalProperties": {
94
- "type": "string"
95
- },
96
- "description": "For branch nodes: condition value -> target node ID mapping"
97
- }
98
- ]
99
- },
100
- "default": {
101
- "type": "string"
102
- },
103
- "join": {
104
- "type": "string"
105
- },
106
- "on_failure": {
107
- "type": "string",
108
- "enum": ["fail_fast", "continue", "ignore"]
109
- },
110
- "description": {
111
- "type": "string"
112
- },
113
- "assignee": {
114
- "type": "string"
115
- },
116
- "timeout": {
117
- "type": "number"
118
- },
119
- "channels": {
120
- "type": "array",
121
- "items": {
122
- "type": "string"
123
- }
124
- },
125
- "comment": {
126
- "type": "string"
127
- },
128
- "on_approve": {
129
- "type": "string"
130
- },
131
- "on_reject": {
132
- "type": "string"
133
- },
134
- "set": {
135
- "type": "object",
136
- "additionalProperties": {
137
- "type": "string"
138
- }
139
- },
140
- "next": {
141
- "type": "string"
142
- },
143
- "on_error": {
144
- "type": "object",
145
- "properties": {
146
- "handler": {
147
- "type": "string"
148
- },
149
- "fallback_node": {
150
- "type": "string"
151
- }
152
- }
153
- }
154
- }
155
- },
156
- "RetryConfig": {
157
- "type": "object",
158
- "required": ["max", "delay"],
159
- "properties": {
160
- "max": {
161
- "type": "number"
162
- },
163
- "delay": {
164
- "type": "string",
165
- "enum": ["exponential", "fixed"]
166
- },
167
- "max_delay": {
168
- "type": "number"
169
- },
170
- "on": {
171
- "type": "array",
172
- "items": {
173
- "type": "string"
174
- }
175
- }
176
- }
177
- }
178
- }
179
- }
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "CrewX Workflow Schema",
4
+ "description": "JSON Schema for crewx.yaml workflows section",
5
+ "type": "object",
6
+ "additionalProperties": {
7
+ "$ref": "#/definitions/WorkflowSpec"
8
+ },
9
+ "definitions": {
10
+ "WorkflowSpec": {
11
+ "type": "object",
12
+ "required": ["nodes"],
13
+ "properties": {
14
+ "metadata": {
15
+ "$ref": "#/definitions/Metadata"
16
+ },
17
+ "timeout": {
18
+ "type": "number"
19
+ },
20
+ "max_iterations": {
21
+ "type": "number"
22
+ },
23
+ "state": {
24
+ "type": "object"
25
+ },
26
+ "nodes": {
27
+ "type": "object",
28
+ "additionalProperties": {
29
+ "$ref": "#/definitions/WorkflowNode"
30
+ }
31
+ }
32
+ }
33
+ },
34
+ "Metadata": {
35
+ "type": "object",
36
+ "required": ["name"],
37
+ "properties": {
38
+ "name": {
39
+ "type": "string"
40
+ },
41
+ "description": {
42
+ "type": "string"
43
+ },
44
+ "version": {
45
+ "type": "string"
46
+ }
47
+ }
48
+ },
49
+ "WorkflowNode": {
50
+ "type": "object",
51
+ "required": ["type"],
52
+ "properties": {
53
+ "type": {
54
+ "type": "string",
55
+ "enum": ["agent_task", "parallel", "join", "branch", "approval", "expression", "end"]
56
+ },
57
+ "agent": {
58
+ "type": "string"
59
+ },
60
+ "mode": {
61
+ "type": "string",
62
+ "enum": ["query", "execute"]
63
+ },
64
+ "input": {
65
+ "type": "string"
66
+ },
67
+ "output": {
68
+ "type": "string"
69
+ },
70
+ "hooks": {
71
+ "type": "array",
72
+ "items": {
73
+ "type": "string"
74
+ }
75
+ },
76
+ "retry": {
77
+ "$ref": "#/definitions/RetryConfig"
78
+ },
79
+ "condition": {
80
+ "type": "string"
81
+ },
82
+ "branches": {
83
+ "oneOf": [
84
+ {
85
+ "type": "array",
86
+ "items": {
87
+ "type": "string"
88
+ },
89
+ "description": "For parallel nodes: array of node IDs to execute concurrently"
90
+ },
91
+ {
92
+ "type": "object",
93
+ "additionalProperties": {
94
+ "type": "string"
95
+ },
96
+ "description": "For branch nodes: condition value -> target node ID mapping"
97
+ }
98
+ ]
99
+ },
100
+ "default": {
101
+ "type": "string"
102
+ },
103
+ "join": {
104
+ "type": "string"
105
+ },
106
+ "on_failure": {
107
+ "type": "string",
108
+ "enum": ["fail_fast", "continue", "ignore"]
109
+ },
110
+ "description": {
111
+ "type": "string"
112
+ },
113
+ "assignee": {
114
+ "type": "string"
115
+ },
116
+ "timeout": {
117
+ "type": "number"
118
+ },
119
+ "channels": {
120
+ "type": "array",
121
+ "items": {
122
+ "type": "string"
123
+ }
124
+ },
125
+ "comment": {
126
+ "type": "string"
127
+ },
128
+ "on_approve": {
129
+ "type": "string"
130
+ },
131
+ "on_reject": {
132
+ "type": "string"
133
+ },
134
+ "set": {
135
+ "type": "object",
136
+ "additionalProperties": {
137
+ "type": "string"
138
+ }
139
+ },
140
+ "next": {
141
+ "type": "string"
142
+ },
143
+ "on_error": {
144
+ "type": "object",
145
+ "properties": {
146
+ "handler": {
147
+ "type": "string"
148
+ },
149
+ "fallback_node": {
150
+ "type": "string"
151
+ }
152
+ }
153
+ },
154
+ "output_format": {
155
+ "type": "string",
156
+ "enum": ["json"],
157
+ "description": "When set to 'json', the engine JSON.parses the agent output and stores it as an object in state"
158
+ },
159
+ "output_schema": {
160
+ "$ref": "#/definitions/JsonSchemaSubset",
161
+ "description": "Optional JSON Schema to validate the parsed output object"
162
+ },
163
+ "output_retry": {
164
+ "type": "integer",
165
+ "minimum": 0,
166
+ "description": "Number of retry attempts if JSON parse or schema validation fails (default: 1)"
167
+ }
168
+ }
169
+ },
170
+ "JsonSchemaSubset": {
171
+ "type": "object",
172
+ "properties": {
173
+ "type": {
174
+ "type": "string",
175
+ "enum": ["object", "array", "string", "number", "boolean"]
176
+ },
177
+ "properties": {
178
+ "type": "object",
179
+ "additionalProperties": {
180
+ "$ref": "#/definitions/JsonSchemaSubset"
181
+ }
182
+ },
183
+ "required": {
184
+ "type": "array",
185
+ "items": { "type": "string" }
186
+ },
187
+ "enum": {
188
+ "type": "array"
189
+ },
190
+ "items": {
191
+ "$ref": "#/definitions/JsonSchemaSubset"
192
+ }
193
+ }
194
+ },
195
+ "RetryConfig": {
196
+ "type": "object",
197
+ "required": ["max", "delay"],
198
+ "properties": {
199
+ "max": {
200
+ "type": "number"
201
+ },
202
+ "delay": {
203
+ "type": "string",
204
+ "enum": ["exponential", "fixed"]
205
+ },
206
+ "max_delay": {
207
+ "type": "number"
208
+ },
209
+ "on": {
210
+ "type": "array",
211
+ "items": {
212
+ "type": "string"
213
+ }
214
+ }
215
+ }
216
+ }
217
+ }
218
+ }