@yiyi_zhang/reactflow-ui 0.1.0 → 0.3.0

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.
@@ -0,0 +1,159 @@
1
+ {
2
+ "workflowId": "wf_mixed_status_demo_001",
3
+ "status": "FAILED",
4
+ "startTime": 1704546000000,
5
+ "endTime": 1704546050000,
6
+ "reasonForIncompletion": "Workflow failed: integration tests failed, blocking downstream tasks",
7
+ "input": { "environment": "production", "version": "3.2.1" },
8
+ "workflowDefinition": {
9
+ "name": "cicd_pipeline_workflow",
10
+ "description": "混合状态演示:CI/CD 流水线,包含完成、运行中、失败和等待中的任务",
11
+ "version": 1,
12
+ "restartable": true,
13
+ "tasks": [
14
+ {
15
+ "name": "checkout_code",
16
+ "taskReferenceName": "checkout_ref",
17
+ "type": "SIMPLE",
18
+ "inputParameters": { "repo": "https://github.com/example/service" }
19
+ },
20
+ {
21
+ "name": "run_tests",
22
+ "taskReferenceName": "test_fork_ref",
23
+ "type": "FORK_JOIN",
24
+ "forkTasks": [
25
+ [
26
+ {
27
+ "name": "unit_tests",
28
+ "taskReferenceName": "unit_test_ref",
29
+ "type": "SIMPLE"
30
+ }
31
+ ],
32
+ [
33
+ {
34
+ "name": "integration_tests",
35
+ "taskReferenceName": "integration_test_ref",
36
+ "type": "HTTP",
37
+ "inputParameters": { "uri": "https://test-runner.internal/run" }
38
+ }
39
+ ],
40
+ [
41
+ {
42
+ "name": "security_scan",
43
+ "taskReferenceName": "security_scan_ref",
44
+ "type": "SIMPLE"
45
+ }
46
+ ]
47
+ ]
48
+ },
49
+ {
50
+ "name": "join_tests",
51
+ "taskReferenceName": "test_join_ref",
52
+ "type": "JOIN",
53
+ "joinOn": ["unit_test_ref", "integration_test_ref", "security_scan_ref"]
54
+ },
55
+ {
56
+ "name": "build_image",
57
+ "taskReferenceName": "build_ref",
58
+ "type": "SIMPLE",
59
+ "inputParameters": { "version": "${workflow.input.version}" }
60
+ },
61
+ {
62
+ "name": "deploy_to_staging",
63
+ "taskReferenceName": "deploy_staging_ref",
64
+ "type": "HTTP",
65
+ "inputParameters": {
66
+ "uri": "https://deploy-api.internal/staging",
67
+ "method": "POST"
68
+ }
69
+ },
70
+ {
71
+ "name": "smoke_tests",
72
+ "taskReferenceName": "smoke_test_ref",
73
+ "type": "SIMPLE"
74
+ },
75
+ {
76
+ "name": "deploy_to_production",
77
+ "taskReferenceName": "deploy_prod_ref",
78
+ "type": "HTTP",
79
+ "inputParameters": {
80
+ "uri": "https://deploy-api.internal/production",
81
+ "method": "POST"
82
+ }
83
+ },
84
+ {
85
+ "name": "notify_release",
86
+ "taskReferenceName": "release_notify_ref",
87
+ "type": "KAFKA_PUBLISH",
88
+ "inputParameters": { "topic": "releases" }
89
+ }
90
+ ],
91
+ "schemaVersion": 2
92
+ },
93
+ "tasks": [
94
+ {
95
+ "taskId": "task_checkout_001",
96
+ "referenceTaskName": "checkout_ref",
97
+ "status": "COMPLETED",
98
+ "taskType": "SIMPLE",
99
+ "startTime": 1704546000000,
100
+ "endTime": 1704546010000,
101
+ "inputData": { "repo": "https://github.com/example/service", "branch": "main" },
102
+ "outputData": { "commitHash": "a1b2c3d4", "filesChanged": 23 }
103
+ },
104
+ {
105
+ "taskId": "task_fork_001",
106
+ "referenceTaskName": "test_fork_ref",
107
+ "status": "COMPLETED",
108
+ "taskType": "FORK",
109
+ "startTime": 1704546011000,
110
+ "endTime": 1704546011100
111
+ },
112
+ {
113
+ "taskId": "task_unit_test_001",
114
+ "referenceTaskName": "unit_test_ref",
115
+ "status": "COMPLETED",
116
+ "taskType": "SIMPLE",
117
+ "startTime": 1704546012000,
118
+ "endTime": 1704546035000,
119
+ "outputData": { "passed": 142, "failed": 0, "coverage": "87%" }
120
+ },
121
+ {
122
+ "taskId": "task_integration_test_001",
123
+ "referenceTaskName": "integration_test_ref",
124
+ "status": "FAILED",
125
+ "taskType": "HTTP",
126
+ "retryCount": 0,
127
+ "startTime": 1704546012000,
128
+ "endTime": 1704546045000,
129
+ "reasonForIncompletion": "Test suite failed: 3 integration tests failed (UserAuth, PaymentFlow, NotificationService)"
130
+ },
131
+ {
132
+ "taskId": "task_security_scan_001",
133
+ "referenceTaskName": "security_scan_ref",
134
+ "status": "COMPLETED",
135
+ "taskType": "SIMPLE",
136
+ "startTime": 1704546012000,
137
+ "endTime": 1704546040000,
138
+ "outputData": { "vulnerabilities": 0, "grade": "A" }
139
+ },
140
+ {
141
+ "taskId": "task_test_join_001",
142
+ "referenceTaskName": "test_join_ref",
143
+ "status": "FAILED",
144
+ "taskType": "JOIN",
145
+ "startTime": 1704546046000,
146
+ "endTime": 1704546046500,
147
+ "reasonForIncompletion": "One or more parallel branches failed"
148
+ },
149
+ {
150
+ "taskId": "task_build_001",
151
+ "referenceTaskName": "build_ref",
152
+ "status": "CANCELED",
153
+ "taskType": "SIMPLE",
154
+ "startTime": 1704546047000,
155
+ "endTime": 1704546048000,
156
+ "inputData": { "version": "3.2.1", "skipTests": true }
157
+ }
158
+ ]
159
+ }
@@ -0,0 +1,160 @@
1
+ {
2
+ "workflowId": "wf_retry_demo_001",
3
+ "status": "COMPLETED",
4
+ "startTime": 1704546000000,
5
+ "endTime": 1704546180000,
6
+ "input": {
7
+ "orderId": "ord_9876",
8
+ "maxRetries": 3
9
+ },
10
+ "output": {
11
+ "orderStatus": "PROCESSED",
12
+ "transactionId": "txn_abc123"
13
+ },
14
+ "workflowDefinition": {
15
+ "name": "payment_processing_workflow",
16
+ "description": "重试机制演示:支付任务重试 2 次后成功,通知任务首次成功",
17
+ "version": 1,
18
+ "tasks": [
19
+ {
20
+ "name": "validate_order",
21
+ "taskReferenceName": "validate_order_ref",
22
+ "type": "SIMPLE",
23
+ "inputParameters": {
24
+ "orderId": "${workflow.input.orderId}"
25
+ }
26
+ },
27
+ {
28
+ "name": "process_payment",
29
+ "taskReferenceName": "process_payment_ref",
30
+ "type": "HTTP",
31
+ "retryCount": 3,
32
+ "retryDelaySeconds": 10,
33
+ "inputParameters": {
34
+ "uri": "https://payment-api.example.com/charge",
35
+ "method": "POST",
36
+ "body": {
37
+ "orderId": "${workflow.input.orderId}"
38
+ }
39
+ }
40
+ },
41
+ {
42
+ "name": "update_inventory",
43
+ "taskReferenceName": "update_inventory_ref",
44
+ "type": "SIMPLE",
45
+ "retryCount": 2,
46
+ "inputParameters": {
47
+ "orderId": "${workflow.input.orderId}"
48
+ }
49
+ },
50
+ {
51
+ "name": "send_confirmation",
52
+ "taskReferenceName": "send_confirm_ref",
53
+ "type": "HTTP",
54
+ "inputParameters": {
55
+ "uri": "https://notify-api.example.com/email",
56
+ "method": "POST"
57
+ }
58
+ }
59
+ ],
60
+ "schemaVersion": 2,
61
+ "restartable": true
62
+ },
63
+ "tasks": [
64
+ {
65
+ "taskId": "task_validate_001",
66
+ "referenceTaskName": "validate_order_ref",
67
+ "status": "COMPLETED",
68
+ "taskType": "SIMPLE",
69
+ "startTime": 1704546000000,
70
+ "endTime": 1704546005000,
71
+ "inputData": {
72
+ "orderId": "ord_9876"
73
+ },
74
+ "outputData": {
75
+ "valid": true,
76
+ "amount": 99.99
77
+ }
78
+ },
79
+ {
80
+ "taskId": "task_payment_retry0",
81
+ "referenceTaskName": "process_payment_ref",
82
+ "status": "FAILED_WITH_TERMINAL_ERROR",
83
+ "taskType": "HTTP",
84
+ "retryCount": 0,
85
+ "startTime": 1704546006000,
86
+ "endTime": 1704546016000,
87
+ "inputData": {
88
+ "orderId": "ord_9876",
89
+ "amount": 99.99
90
+ },
91
+ "reasonForIncompletion": "Connection timeout: payment gateway unreachable"
92
+ },
93
+ {
94
+ "taskId": "task_payment_retry1",
95
+ "referenceTaskName": "process_payment_ref",
96
+ "status": "FAILED_WITH_TERMINAL_ERROR",
97
+ "taskType": "HTTP",
98
+ "retryCount": 1,
99
+ "startTime": 1704546026000,
100
+ "endTime": 1704546036000,
101
+ "inputData": {
102
+ "orderId": "ord_9876",
103
+ "amount": 99.99
104
+ },
105
+ "reasonForIncompletion": "HTTP 503: Service Temporarily Unavailable"
106
+ },
107
+ {
108
+ "taskId": "task_payment_retry2",
109
+ "referenceTaskName": "process_payment_ref",
110
+ "status": "COMPLETED",
111
+ "taskType": "HTTP",
112
+ "retryCount": 2,
113
+ "startTime": 1704546046000,
114
+ "endTime": 1704546056000,
115
+ "inputData": {
116
+ "orderId": "ord_9876",
117
+ "amount": 99.99
118
+ },
119
+ "outputData": {
120
+ "transactionId": "txn_abc123",
121
+ "status": "APPROVED"
122
+ }
123
+ },
124
+ {
125
+ "taskId": "task_inventory_retry0",
126
+ "referenceTaskName": "update_inventory_ref",
127
+ "status": "FAILED",
128
+ "taskType": "SIMPLE",
129
+ "retryCount": 0,
130
+ "startTime": 1704546057000,
131
+ "endTime": 1704546067000,
132
+ "reasonForIncompletion": "Database deadlock detected"
133
+ },
134
+ {
135
+ "taskId": "task_inventory_retry1",
136
+ "referenceTaskName": "update_inventory_ref",
137
+ "status": "COMPLETED",
138
+ "taskType": "SIMPLE",
139
+ "retryCount": 1,
140
+ "startTime": 1704546077000,
141
+ "endTime": 1704546085000,
142
+ "outputData": {
143
+ "updated": true,
144
+ "newStock": 42
145
+ }
146
+ },
147
+ {
148
+ "taskId": "task_confirm_001",
149
+ "referenceTaskName": "send_confirm_ref",
150
+ "status": "COMPLETED",
151
+ "taskType": "HTTP",
152
+ "startTime": 1704546086000,
153
+ "endTime": 1704546090000,
154
+ "outputData": {
155
+ "emailSent": true,
156
+ "messageId": "msg_confirm_456"
157
+ }
158
+ }
159
+ ]
160
+ }
@@ -0,0 +1,173 @@
1
+ {
2
+ "workflowId": "wf_switch_demo_001",
3
+ "status": "COMPLETED",
4
+ "startTime": 1704546000000,
5
+ "endTime": 1704546090000,
6
+ "input": {
7
+ "userType": "premium",
8
+ "requestId": "req_555"
9
+ },
10
+ "output": {
11
+ "processed": true,
12
+ "tier": "premium"
13
+ },
14
+ "workflowDefinition": {
15
+ "name": "user_tier_workflow",
16
+ "description": "SWITCH 分支演示:根据用户类型走不同处理路径(premium 分支执行)",
17
+ "version": 1,
18
+ "tasks": [
19
+ {
20
+ "name": "lookup_user",
21
+ "taskReferenceName": "lookup_user_ref",
22
+ "type": "HTTP",
23
+ "inputParameters": {
24
+ "uri": "https://api.example.com/users/${workflow.input.requestId}",
25
+ "method": "GET"
26
+ }
27
+ },
28
+ {
29
+ "name": "route_by_tier",
30
+ "taskReferenceName": "route_ref",
31
+ "type": "SWITCH",
32
+ "inputParameters": {
33
+ "switchCaseValue": "${workflow.input.userType}"
34
+ },
35
+ "evaluatorType": "value-param",
36
+ "expression": "switchCaseValue",
37
+ "decisionCases": {
38
+ "premium": [
39
+ {
40
+ "name": "premium_processing",
41
+ "taskReferenceName": "premium_proc_ref",
42
+ "type": "SIMPLE",
43
+ "inputParameters": {
44
+ "priority": "high",
45
+ "sla": "1h"
46
+ }
47
+ },
48
+ {
49
+ "name": "premium_notify",
50
+ "taskReferenceName": "premium_notify_ref",
51
+ "type": "EVENT",
52
+ "inputParameters": {
53
+ "sink": "sqs:premium-events"
54
+ }
55
+ }
56
+ ],
57
+ "standard": [
58
+ {
59
+ "name": "standard_processing",
60
+ "taskReferenceName": "standard_proc_ref",
61
+ "type": "SIMPLE",
62
+ "inputParameters": {
63
+ "priority": "normal",
64
+ "sla": "24h"
65
+ }
66
+ }
67
+ ],
68
+ "free": [
69
+ {
70
+ "name": "queue_request",
71
+ "taskReferenceName": "queue_ref",
72
+ "type": "SET_VARIABLE",
73
+ "inputParameters": {
74
+ "queuePosition": "${workflow.input.requestId}"
75
+ }
76
+ }
77
+ ]
78
+ },
79
+ "defaultCase": [
80
+ {
81
+ "name": "handle_unknown_tier",
82
+ "taskReferenceName": "unknown_tier_ref",
83
+ "type": "TERMINATE",
84
+ "inputParameters": {
85
+ "terminationStatus": "FAILED",
86
+ "reasonForIncompletion": "Unknown user tier"
87
+ }
88
+ }
89
+ ]
90
+ },
91
+ {
92
+ "name": "log_completion",
93
+ "taskReferenceName": "log_ref",
94
+ "type": "INLINE",
95
+ "inputParameters": {
96
+ "expression": "console.log('Workflow complete')"
97
+ }
98
+ }
99
+ ],
100
+ "schemaVersion": 2,
101
+ "restartable": true
102
+ },
103
+ "tasks": [
104
+ {
105
+ "taskId": "task_lookup_001",
106
+ "referenceTaskName": "lookup_user_ref",
107
+ "status": "COMPLETED",
108
+ "taskType": "HTTP",
109
+ "startTime": 1704546000000,
110
+ "endTime": 1704546005000,
111
+ "inputData": {
112
+ "uri": "https://api.example.com/users/req_555"
113
+ },
114
+ "outputData": {
115
+ "userId": "usr_999",
116
+ "tier": "premium",
117
+ "email": "user@example.com"
118
+ }
119
+ },
120
+ {
121
+ "taskId": "task_switch_001",
122
+ "referenceTaskName": "route_ref",
123
+ "status": "COMPLETED",
124
+ "taskType": "SWITCH",
125
+ "startTime": 1704546006000,
126
+ "endTime": 1704546006500,
127
+ "inputData": {
128
+ "switchCaseValue": "premium"
129
+ },
130
+ "outputData": {
131
+ "caseOutput": "premium"
132
+ }
133
+ },
134
+ {
135
+ "taskId": "task_premium_proc_001",
136
+ "referenceTaskName": "premium_proc_ref",
137
+ "status": "COMPLETED",
138
+ "taskType": "SIMPLE",
139
+ "startTime": 1704546007000,
140
+ "endTime": 1704546040000,
141
+ "inputData": {
142
+ "priority": "high",
143
+ "sla": "1h"
144
+ },
145
+ "outputData": {
146
+ "jobId": "job_premium_789",
147
+ "estimatedTime": "45m"
148
+ }
149
+ },
150
+ {
151
+ "taskId": "task_premium_notify_001",
152
+ "referenceTaskName": "premium_notify_ref",
153
+ "status": "COMPLETED",
154
+ "taskType": "EVENT",
155
+ "startTime": 1704546041000,
156
+ "endTime": 1704546043000,
157
+ "outputData": {
158
+ "eventId": "evt_premium_sent"
159
+ }
160
+ },
161
+ {
162
+ "taskId": "task_log_001",
163
+ "referenceTaskName": "log_ref",
164
+ "status": "COMPLETED",
165
+ "taskType": "INLINE",
166
+ "startTime": 1704546044000,
167
+ "endTime": 1704546046000,
168
+ "outputData": {
169
+ "result": "logged"
170
+ }
171
+ }
172
+ ]
173
+ }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Conductor 任务类型枚举
3
3
  */
4
- export type TaskType = 'SIMPLE' | 'DYNAMIC' | 'FORK_JOIN' | 'FORK_JOIN_DYNAMIC' | 'DECISION' | 'SWITCH' | 'JOIN' | 'DO_WHILE' | 'SUB_WORKFLOW' | 'EVENT' | 'WAIT' | 'HUMAN' | 'USER_DEFINED' | 'HTTP' | 'LAMBDA' | 'EXCLUSIVE_JOIN' | 'TERMINATE' | 'KAFKA_PUBLISH' | 'JSON_JQ_TRANSFORM' | 'SET_VARIABLE';
4
+ export type TaskType = 'SIMPLE' | 'DYNAMIC' | 'FORK_JOIN' | 'FORK_JOIN_DYNAMIC' | 'DECISION' | 'SWITCH' | 'JOIN' | 'EXCLUSIVE_JOIN' | 'DO_WHILE' | 'SUB_WORKFLOW' | 'EVENT' | 'WAIT' | 'HUMAN' | 'USER_DEFINED' | 'HTTP' | 'INLINE' | 'LAMBDA' | 'TERMINATE' | 'KAFKA_PUBLISH' | 'JSON_JQ_TRANSFORM' | 'SET_VARIABLE' | 'START_WORKFLOW' | 'NOOP';
5
5
  /**
6
6
  * Conductor 任务定义
7
7
  */
@@ -47,11 +47,30 @@ export interface TaskDef {
47
47
  uri?: string;
48
48
  headers?: Record<string, string>;
49
49
  body?: any;
50
+ contentType?: string;
51
+ accept?: string;
52
+ connectionTimeOut?: number;
53
+ readTimeOut?: number;
50
54
  };
51
55
  sink?: string;
56
+ evaluatorType?: 'graaljs' | 'javascript' | 'value-param' | 'python';
52
57
  caseExpression?: string;
58
+ keepLastN?: number;
59
+ forkTaskType?: string;
60
+ forkTaskName?: string;
61
+ forkTaskWorkflow?: string;
62
+ forkTaskWorkflowVersion?: string;
63
+ dynamicTaskNameParam?: string;
64
+ humanTaskDef?: {
65
+ userFormTemplate?: string;
66
+ assignmentCompletionStrategy?: string;
67
+ displayName?: string;
68
+ };
53
69
  retryCount?: number;
70
+ retryLogic?: 'FIXED' | 'EXPONENTIAL_BACKOFF' | 'LINEAR_BACKOFF';
71
+ retryDelaySeconds?: number;
54
72
  timeoutSeconds?: number;
73
+ timeoutPolicy?: 'RETRY' | 'TIME_OUT_WF' | 'ALERT_ONLY' | 'FAIL_WORKFLOW';
55
74
  }
56
75
  /**
57
76
  * Conductor 工作流定义