Skip to main content
Runtime is the execution environment where your workflows run. It sets the boundaries for what LLMs can access and do. Dify offers two runtime environments: Sandboxed Runtime and Classic Runtime, each optimized for different use cases.
Workflow Runtime

Overview

Best for: Complex tasks where LLMs need autonomy to solve problems their own way. More powerful, but slower and more token-intensive.
Sandboxed runtime enables LLMs to execute commands in an isolated environment. Anything you can do with commands in a terminal, they can do:
  • Run scripts and programs - Execute code to process data, generate outputs, or perform any computation
  • Install what’s needed - Download libraries and tools on demand using pip or other package managers
  • Access external resources - Fetch files from URLs, clone repositories, or retrieve data from external sources
  • Work with files - Access resources like skills in the file system, process files across formats, and generate multimodal artifacts using scripts and tools
In sandboxed runtime, the Agent node combines the roles of both the LLM and Agent nodes in classic runtime.For quick, simple tasks that don’t need these advanced capabilities, you can disable them by turning off Agent Mode for faster responses and lower token costs.
LLMs become true agents. As long as the model has strong tool calling and reasoning abilities, it can determine what commands to run and execute them to complete tasks autonomously.LLMs are more powerful, and that’s exactly why they need to run in a sandbox. The isolated environment gives them enough freedom to work while ensuring safe operations.
For the default sandbox provider:
  • Dify Cloud uses E2B.
  • Self-hosting deployments use SSH VM.
Choose and configure other providers in Settings > Sandbox Provider.

Quick Comparison

DimensionSandboxed RuntimeClassic Runtime
Best forComplex, autonomous problem-solvingSimple, well-defined tasks
LLM AutonomyRuns any command it needsUses tools you configure
File System
Skills
App Export Format.zip (DSL + file system content).yml (DSL)