Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const SUBFLOW_CONFIG = {
},
typeKey: 'loopType' as const,
storeKey: 'loops' as const,
maxIterations: 100,
maxIterations: 1000,
configKeys: {
iterations: 'iterations' as const,
items: 'forEachItems' as const,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/hooks/use-collaborative-workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1540,7 +1540,7 @@ export function useCollaborativeWorkflow() {
const config = {
id: nodeId,
nodes: childNodes,
iterations: Math.max(1, Math.min(100, count)), // Clamp between 1-100 for loops
iterations: Math.max(1, Math.min(1000, count)), // Clamp between 1-1000 for loops
loopType: currentLoopType,
forEachItems: currentCollection,
}
Expand Down
6 changes: 3 additions & 3 deletions apps/sim/stores/workflows/workflow/store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ describe('workflow store', () => {
expect(state.loops.loop1.forEachItems).toEqual(['item1', 'item2', 'item3'])
})

it('should clamp loop count between 1 and 100', () => {
it('should clamp loop count between 1 and 1000', () => {
const { addBlock, updateLoopCount } = useWorkflowStore.getState()

// Add a loop block
Expand All @@ -126,9 +126,9 @@ describe('workflow store', () => {
)

// Try to set count above max
updateLoopCount('loop1', 150)
updateLoopCount('loop1', 1500)
let state = useWorkflowStore.getState()
expect(state.blocks.loop1?.data?.count).toBe(100)
expect(state.blocks.loop1?.data?.count).toBe(1000)

// Try to set count below min
updateLoopCount('loop1', 0)
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/stores/workflows/workflow/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ export const useWorkflowStore = create<WorkflowStore>()(
...block,
data: {
...block.data,
count: Math.max(1, Math.min(100, count)), // Clamp between 1-100
count: Math.max(1, Math.min(1000, count)), // Clamp between 1-1000
},
},
}
Expand Down
Loading