feat(block): Allow wait block to wait up to 30 days#4331
feat(block): Allow wait block to wait up to 30 days#4331TheodoreSpeaks merged 53 commits intostagingfrom
Conversation
…ership workflow edits via sockets, ui improvements
…ng improvements, posthog, secrets mutations
…ration, signup method feature flags, SSO improvements
…nts, secrets performance, polling refactors, drag resources in mothership
…y invalidation, HITL docs
…endar triggers, docs updates, integrations/models pages improvements
…ions, jira forms endpoints
…mat, logs performance improvements fix(csp): add missing analytics domains, remove unsafe-eval, fix workspace CSP gap (#4179) fix(landing): return 404 for invalid dynamic route slugs (#4182) improvement(seo): optimize sitemaps, robots.txt, and core web vitals across sim and docs (#4170) fix(gemini): support structured output with tools on Gemini 3 models (#4184) feat(brightdata): add Bright Data integration with 8 tools (#4183) fix(mothership): fix superagent credentials (#4185) fix(logs): close sidebar when selected log disappears from filtered list; cleanup (#4186)
v0.6.46: mothership streaming fixes, brightdata integration
…m integration, atlassian triggers
PR SummaryMedium Risk Overview Introduces automatic resumption for long waits via a new cron-protected Updates pause/resume plumbing to track Reviewed by Cursor Bugbot for commit 4d44471. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR extends the Wait block to support durations up to 30 days by reusing the human-in-the-loop pause/resume infrastructure. Waits ≤ 5 minutes continue to execute in-process; longer waits suspend the workflow by writing
Confidence Score: 3/5Not safe to merge until the failed-dispatch silent-strand bug is fixed; any transient error during resume dispatch permanently locks a workflow. A confirmed P1 defect in the new poll route means any transient DB or lock error during dispatch will permanently orphan a paused execution with no retry or observability. The rest of the implementation (schema migration, in-process vs. suspended branching, UI filtering, cron config) is well-structured and correct. apps/sim/app/api/resume/poll/route.ts — the failed-dispatch no-retry bug and missing ORDER BY Important Files Changed
Sequence DiagramsequenceDiagram
participant W as WaitBlockHandler
participant E as ExecutionEngine
participant M as PauseResumeManager
participant DB as pausedExecutions DB
participant C as CronJob (/api/resume/poll)
W->>W: execute(inputs)
alt waitMs ≤ 5 min (in-process)
W->>W: sleep(waitMs)
W-->>E: {status: 'completed'}
else waitMs > 5 min (suspended)
W-->>E: {status: 'waiting', _pauseMetadata: {pauseKind: 'time', resumeAt}}
E->>M: persistPauseResult(pausePoints)
M->>M: compute nextResumeAt (earliest time pause point)
M->>DB: INSERT/UPDATE pausedExecutions {nextResumeAt}
end
loop Every 1 minute
C->>DB: SELECT WHERE status='paused' AND nextResumeAt <= now LIMIT 200
DB-->>C: dueRows[]
loop for each dueRow
loop for each duePoint (pauseKind='time', resumeAt <= now)
C->>M: enqueueOrStartResume({executionId, contextId})
M-->>C: {status: 'starting', ...}
C->>M: startResumeExecution() [fire and forget]
end
C->>DB: UPDATE SET nextResumeAt = nextRemaining (null if all done)
end
end
Reviews (1): Last reviewed commit: "restore ff" | Re-trigger Greptile |
…rizations, mothership positional table row insertion, CI improvements, org-external users, file viewer improvements
v0.6.62: fix new copilot chat creation and selection on refresh
…ixes, db query optimizations, contract boundaries code hygiene, CORS, toast improvements, tables infinite query, executor robustness, reranker support
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 29606901 | Triggered | Generic High Entropy Secret | a54dcbe | apps/sim/providers/utils.test.ts | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
- Parallelize per-row dispatch with Promise.all - Add status='paused' guard on nextResumeAt rewrite to prevent clobbering concurrent resumes - Extract computeEarliestResumeAt + PauseResumeManager.setNextResumeAt helpers - Use canonical PausePoint type in poll route (drop StoredPausePoint) - Narrow UNIT_TO_MS via as const + WaitUnit guard - Bump LOCK_TTL_SECONDS above route maxDuration - Clearer error when allowedPauseKinds rejects a resume
- Renumber wait migration 0201 -> 0202 (staging took 0201) - Bump api-validation baseline to 726 (725 from staging + 1) - Set output.status = 'completed' on time-pause resume so downstream blocks see the same status as in-process waits
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 3 total unresolved issues (including 2 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 491af0e. Configure here.
- Renumber wait migration 0202 -> 0203 (staging took 0202) - Bump api-validation baseline to 727 - Use parseFloat + Math.round so fractional values (e.g. 1.5 days) keep their sub-unit portion - Pass allowedPauseKinds: ['time'] from poll route for defense-in-depth - ORDER BY next_resume_at on poll batch so backlog drains fairly - Widen WaitBlockHandler.executeWithNode signature to match BlockHandler interface

Summary
Reuse human in the loop logic to allow wait blocks to wait up to 30 days. Think this could be useful for things like email automation where you want to send followups after x days.
Type of Change
Testing
Checklist
Screenshots/Videos