Skip to content

Commit b1f099b

Browse files
committed
update trigger-save UI, increase auto disable to 100 consecutive from 10
1 parent a177a14 commit b1f099b

File tree

8 files changed

+41
-58
lines changed

8 files changed

+41
-58
lines changed

apps/docs/content/docs/en/triggers/schedule.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ You must deploy your workflow for the schedule to start running. Configure the s
5656

5757
## Automatic Disabling
5858

59-
Schedules automatically disable after **10 consecutive failures** to prevent runaway errors. When disabled:
59+
Schedules automatically disable after **100 consecutive failures** to prevent runaway errors. When disabled:
6060

6161
- A warning badge appears on the schedule block
6262
- The schedule stops executing

apps/sim/app/api/schedules/route.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ describe('Schedule GET API', () => {
144144
it('indicates disabled schedule with failures', async () => {
145145
mockDbChain([
146146
[{ userId: 'user-1', workspaceId: null }],
147-
[{ id: 'sched-1', status: 'disabled', failedCount: 10 }],
147+
[{ id: 'sched-1', status: 'disabled', failedCount: 100 }],
148148
])
149149

150150
const res = await GET(createRequest('http://test/api/schedules?workflowId=wf-1'))

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/schedule-info/schedule-info.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function ScheduleInfo({ blockId, isPreview = false }: ScheduleInfoProps)
4646
{(failedCount > 0 || isDisabled) && (
4747
<div className='space-y-1'>
4848
<div className='flex flex-wrap items-center gap-2'>
49-
{failedCount >= 10 && isDisabled ? (
49+
{failedCount >= 100 && isDisabled ? (
5050
<Badge
5151
variant='outline'
5252
className='cursor-pointer'
@@ -70,9 +70,9 @@ export function ScheduleInfo({ blockId, isPreview = false }: ScheduleInfoProps)
7070
</Badge>
7171
) : null}
7272
</div>
73-
{failedCount >= 10 && isDisabled && (
73+
{failedCount >= 100 && isDisabled && (
7474
<p className='text-[12px] text-[var(--text-tertiary)]'>
75-
Disabled after 10 consecutive failures
75+
Disabled after 100 consecutive failures
7676
</p>
7777
)}
7878
</div>

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/trigger-save/trigger-save.tsx

Lines changed: 32 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
ModalHeader,
99
} from '@/components/emcn/components'
1010
import { Trash } from '@/components/emcn/icons/trash'
11-
import { Alert, AlertDescription } from '@/components/ui/alert'
1211
import { cn } from '@/lib/core/utils/cn'
1312
import { createLogger } from '@/lib/logs/console/logger'
1413
import { useCollaborativeWorkflow } from '@/hooks/use-collaborative-workflow'
@@ -367,12 +366,7 @@ export function TriggerSave({
367366
saveStatus === 'error' && 'bg-red-600 hover:bg-red-700'
368367
)}
369368
>
370-
{saveStatus === 'saving' && (
371-
<>
372-
<div className='mr-2 h-4 w-4 animate-spin rounded-full border-[1.5px] border-current border-t-transparent' />
373-
Saving...
374-
</>
375-
)}
369+
{saveStatus === 'saving' && 'Saving...'}
376370
{saveStatus === 'saved' && 'Saved'}
377371
{saveStatus === 'error' && 'Error'}
378372
{saveStatus === 'idle' && (webhookId ? 'Update Configuration' : 'Save Configuration')}
@@ -394,59 +388,48 @@ export function TriggerSave({
394388
)}
395389
</div>
396390

397-
{errorMessage && (
398-
<Alert variant='destructive' className='mt-2'>
399-
<AlertDescription>{errorMessage}</AlertDescription>
400-
</Alert>
401-
)}
391+
{errorMessage && <p className='mt-2 text-[12px] text-[var(--text-error)]'>{errorMessage}</p>}
402392

403393
{webhookId && hasWebhookUrlDisplay && (
404-
<div className='mt-2 space-y-1'>
394+
<div className='mt-4 space-y-2'>
405395
<div className='flex items-center justify-between'>
406-
<span className='font-medium text-sm'>Test Webhook URL</span>
396+
<span className='font-medium text-[13px] text-[var(--text-primary)]'>
397+
Test Webhook URL
398+
</span>
407399
<Button
408-
variant='outline'
400+
variant='ghost'
409401
onClick={generateTestUrl}
410402
disabled={isGeneratingTestUrl || isProcessing}
411-
className='h-[32px] rounded-[8px] px-[12px]'
412403
>
413-
{isGeneratingTestUrl ? (
414-
<>
415-
<div className='mr-2 h-3 w-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent' />
416-
Generating…
417-
</>
418-
) : testUrl ? (
419-
'Regenerate'
420-
) : (
421-
'Generate'
422-
)}
404+
{isGeneratingTestUrl ? 'Generating…' : testUrl ? 'Regenerate' : 'Generate'}
423405
</Button>
424406
</div>
425407
{testUrl ? (
426-
<ShortInput
427-
blockId={blockId}
428-
subBlockId={`${subBlockId}-test-url`}
429-
config={{
430-
id: `${subBlockId}-test-url`,
431-
type: 'short-input',
432-
readOnly: true,
433-
showCopyButton: true,
434-
}}
435-
value={testUrl}
436-
readOnly={true}
437-
showCopyButton={true}
438-
disabled={isPreview || disabled}
439-
isPreview={isPreview}
440-
/>
408+
<>
409+
<ShortInput
410+
blockId={blockId}
411+
subBlockId={`${subBlockId}-test-url`}
412+
config={{
413+
id: `${subBlockId}-test-url`,
414+
type: 'short-input',
415+
readOnly: true,
416+
showCopyButton: true,
417+
}}
418+
value={testUrl}
419+
readOnly={true}
420+
showCopyButton={true}
421+
disabled={isPreview || disabled}
422+
isPreview={isPreview}
423+
/>
424+
{testUrlExpiresAt && (
425+
<p className='text-[12px] text-[var(--text-tertiary)]'>
426+
Expires {new Date(testUrlExpiresAt).toLocaleString()}
427+
</p>
428+
)}
429+
</>
441430
) : (
442-
<p className='text-muted-foreground text-xs'>
443-
Generate a temporary URL that executes this webhook against the live (undeployed)
444-
workflow state.
445-
</p>
446-
)}
447-
{testUrlExpiresAt && (
448-
<p className='text-muted-foreground text-xs'>
449-
Expires at {new Date(testUrlExpiresAt).toLocaleString()}
431+
<p className='text-[12px] text-[var(--text-tertiary)]'>
432+
Generate a temporary URL to test against the live (undeployed) workflow state.
450433
</p>
451434
)}
452435
</div>

apps/sim/background/schedule-execution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { mergeSubblockState } from '@/stores/workflows/server-utils'
3030

3131
const logger = createLogger('TriggerScheduleExecution')
3232

33-
const MAX_CONSECUTIVE_FAILURES = 10
33+
const MAX_CONSECUTIVE_FAILURES = 100
3434

3535
type WorkflowRecord = typeof workflow.$inferSelect
3636
type WorkflowScheduleUpdate = Partial<typeof workflowSchedule.$inferInsert>

apps/sim/lib/webhooks/gmail-polling-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { downloadAttachments, extractAttachmentInfo } from '@/tools/gmail/utils'
1111

1212
const logger = createLogger('GmailPollingService')
1313

14-
const MAX_CONSECUTIVE_FAILURES = 10
14+
const MAX_CONSECUTIVE_FAILURES = 100
1515

1616
interface GmailWebhookConfig {
1717
labelIds: string[]

apps/sim/lib/webhooks/outlook-polling-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { getOAuthToken, refreshAccessTokenIfNeeded } from '@/app/api/auth/oauth/
1010

1111
const logger = createLogger('OutlookPollingService')
1212

13-
const MAX_CONSECUTIVE_FAILURES = 10
13+
const MAX_CONSECUTIVE_FAILURES = 100
1414

1515
async function markWebhookFailed(webhookId: string) {
1616
try {

apps/sim/lib/webhooks/rss-polling-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { createLogger } from '@/lib/logs/console/logger'
1010

1111
const logger = createLogger('RssPollingService')
1212

13-
const MAX_CONSECUTIVE_FAILURES = 10
13+
const MAX_CONSECUTIVE_FAILURES = 100
1414
const MAX_GUIDS_TO_TRACK = 100 // Track recent guids to prevent duplicates
1515

1616
interface RssWebhookConfig {

0 commit comments

Comments
 (0)