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 @@ -30,7 +30,7 @@ export function useAccessibleReferencePrefixes(blockId?: string | null): Set<str
const starterBlock = Object.values(blocks).find(
(block) => block.type === 'starter' || block.type === 'start_trigger'
)
if (starterBlock) {
if (starterBlock && ancestorIds.includes(starterBlock.id)) {
accessibleIds.add(starterBlock.id)
}

Expand Down
5 changes: 3 additions & 2 deletions apps/sim/lib/block-path-calculator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ export class BlockPathCalculator {
const pathNodes = BlockPathCalculator.findAllPathNodes(workflow.connections, block.id)
pathNodes.forEach((nodeId) => accessibleBlocks.add(nodeId))

// Always allow referencing the starter block (special case)
// Only add starter block if it's actually upstream (already in pathNodes)
// Don't add it just because it exists on the canvas
const starterBlock = workflow.blocks.find((b) => b.metadata?.id === 'starter')
if (starterBlock && starterBlock.id !== block.id) {
if (starterBlock && starterBlock.id !== block.id && pathNodes.includes(starterBlock.id)) {
accessibleBlocks.add(starterBlock.id)
}

Expand Down
4 changes: 3 additions & 1 deletion apps/sim/serializer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,9 @@ export class Serializer {
const accessibleIds = new Set<string>(ancestorIds)
accessibleIds.add(blockId)

if (starterBlock) {
// Only add starter block if it's actually upstream (already in ancestorIds)
// Don't add it just because it exists on the canvas
if (starterBlock && ancestorIds.includes(starterBlock.id)) {
accessibleIds.add(starterBlock.id)
}

Expand Down