Skip to content

Commit d6bf221

Browse files
committed
Adds workflow node types and OpenAI integration
Expands workflow capabilities by introducing branch, loop, webhook, and schedule node types with appropriate configuration fields and validation. Adds OpenAI API key to environment configuration to enable AI-powered workflow features. Improves form styling with proper box-sizing for better layout consistency.
1 parent b74860d commit d6bf221

3 files changed

Lines changed: 36 additions & 0 deletions

File tree

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ SUPABASE_URL=https://[YOUR-PROJECT-REF].supabase.co
88
SUPABASE_ANON_KEY=[YOUR-ANON-KEY]
99
SUPABASE_SERVICE_ROLE_KEY=[YOUR-SERVICE-ROLE-KEY]
1010

11+
OPENAI_API_KEY=your-openai-api-key
12+
1113
# Application Settings
1214
NODE_ENV=production
1315
PORT=8080

apps/web/src/lib/components/NodeConfigModal.svelte

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,31 @@
3434
{ name: 'description', label: 'Description', type: 'text', placeholder: 'Condition description' }
3535
]
3636
},
37+
branch: {
38+
fields: [
39+
{ name: 'branches', label: 'Number of Branches', type: 'number', required: true, placeholder: '2', min: 2, max: 10 },
40+
{ name: 'description', label: 'Description', type: 'text', placeholder: 'Branch description (e.g., "Broadcast to Discord and Slack")' }
41+
]
42+
},
43+
loop: {
44+
fields: [
45+
{ name: 'items', label: 'Items Expression (JMESPath)', type: 'textarea', required: true, placeholder: 'data.items[*]' },
46+
{ name: 'description', label: 'Description', type: 'text', placeholder: 'Loop description' }
47+
]
48+
},
49+
webhook: {
50+
fields: [
51+
{ name: 'path', label: 'Webhook Path', type: 'text', required: true, placeholder: '/hooks/my-workflow' },
52+
{ name: 'description', label: 'Description', type: 'text', placeholder: 'Webhook description' }
53+
]
54+
},
55+
schedule: {
56+
fields: [
57+
{ name: 'cron', label: 'Cron Expression', type: 'text', required: true, placeholder: '0 0 * * *' },
58+
{ name: 'timezone', label: 'Timezone', type: 'text', placeholder: 'America/Los_Angeles' },
59+
{ name: 'description', label: 'Description', type: 'text', placeholder: 'Schedule description' }
60+
]
61+
},
3762
terminate: {
3863
fields: [
3964
{ name: 'reason', label: 'Termination Reason', type: 'text', placeholder: 'Workflow completed' },
@@ -99,6 +124,8 @@
99124
bind:value={config[field.name]}
100125
placeholder={field.placeholder || ''}
101126
required={field.required}
127+
min={field.min}
128+
max={field.max}
102129
/>
103130
{:else if field.type === 'textarea'}
104131
<textarea
@@ -224,6 +251,7 @@
224251
font-size: 0.875rem;
225252
font-family: inherit;
226253
transition: border-color 0.2s;
254+
box-sizing: border-box;
227255
}
228256
229257
input:focus,

apps/web/src/lib/components/NodePalette.svelte

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@
5050
icon: '🔀',
5151
description: 'Branch based on condition'
5252
},
53+
{
54+
type: 'branch',
55+
label: 'Branch',
56+
icon: '🌿',
57+
description: 'Split flow to multiple paths'
58+
},
5359
{
5460
type: 'loop',
5561
label: 'Loop',

0 commit comments

Comments
 (0)