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
3 changes: 2 additions & 1 deletion apps/sim/app/api/function/execute/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createContext, Script } from 'vm'
import { type NextRequest, NextResponse } from 'next/server'
import { env, isTruthy } from '@/lib/env'
import { executeInE2B } from '@/lib/execution/e2b'
import { CodeLanguage, DEFAULT_CODE_LANGUAGE, isValidCodeLanguage } from '@/lib/execution/languages'
import { createLogger } from '@/lib/logs/console/logger'
Expand Down Expand Up @@ -579,7 +580,7 @@ export async function POST(req: NextRequest) {
resolvedCode = codeResolution.resolvedCode
const contextVariables = codeResolution.contextVariables

const e2bEnabled = process.env.E2B_ENABLED === 'true'
const e2bEnabled = isTruthy(env.E2B_ENABLED)
const lang = isValidCodeLanguage(language) ? language : DEFAULT_CODE_LANGUAGE
const useE2B =
e2bEnabled &&
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Info } from 'lucide-react'
import { Label, Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui'
import { Switch as UISwitch } from '@/components/ui/switch'
import { env } from '@/lib/env'
import { getEnv, isTruthy } from '@/lib/env'
import { useSubBlockValue } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/hooks/use-sub-block-value'

interface E2BSwitchProps {
Expand All @@ -23,7 +23,7 @@ export function E2BSwitch({
previewValue,
disabled = false,
}: E2BSwitchProps) {
const e2bEnabled = env.NEXT_PUBLIC_E2B_ENABLED === 'true'
const e2bEnabled = isTruthy(getEnv('NEXT_PUBLIC_E2B_ENABLED'))
if (!e2bEnabled) return null

const [storeValue, setStoreValue] = useSubBlockValue<boolean>(blockId, subBlockId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Badge } from '@/components/ui/badge'
import { Button } from '@/components/ui/button'
import { Card } from '@/components/ui/card'
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
import { env } from '@/lib/env'
import { getEnv, isTruthy } from '@/lib/env'
import { createLogger } from '@/lib/logs/console/logger'
import { parseCronToHumanReadable } from '@/lib/schedules/utils'
import { cn, validateName } from '@/lib/utils'
Expand Down Expand Up @@ -443,7 +443,7 @@ export function WorkflowBlock({ id, data }: NodeProps<WorkflowBlockProps>) {
const isTriggerMode = useWorkflowStore.getState().blocks[blockId]?.triggerMode ?? false
const effectiveAdvanced = currentWorkflow.isDiffMode ? displayAdvancedMode : isAdvancedMode
const effectiveTrigger = currentWorkflow.isDiffMode ? displayTriggerMode : isTriggerMode
const e2bClientEnabled = env.NEXT_PUBLIC_E2B_ENABLED === 'true'
const e2bClientEnabled = isTruthy(getEnv('NEXT_PUBLIC_E2B_ENABLED'))

// Filter visible blocks and those that meet their conditions
const visibleSubBlocks = subBlocks.filter((block) => {
Expand Down