Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • Compute Services
  • System Modeler
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

Wolfram Consulting

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Notebook Assistant + LLM Kit
    • Compute Services
    • System Modeler
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
StartExternalSession   
  • See Also
    • ExternalEvaluate
    • ExternalSessions
    • ExternalSessionObject
    • ExternalEvaluators
    • ExternalFunction
    • ExternalObject
    • StartProcess
    • DeleteObject
    • StartWebSession

    • External Evaluation Systems
    • Python
    • NodeJS
    • Julia
    • Ruby
    • R
    • Shell
    • Jupyter
    • SQL
    • SQL-JDBC
  • Related Guides
    • External Language Interfaces
    • Database Connectivity
    • Calling External Programs
    • External Interpreted Language Interfaces
    • Working with Information in Relational Databases
  • Workflows
    • Configure Python for ExternalEvaluate
    • Configure Node.js for ExternalEvaluate
    • Configure Julia for ExternalEvaluate
    • Configure Ruby for ExternalEvaluate
    • Execute a Python File with ExternalEvaluate
    • See Also
      • ExternalEvaluate
      • ExternalSessions
      • ExternalSessionObject
      • ExternalEvaluators
      • ExternalFunction
      • ExternalObject
      • StartProcess
      • DeleteObject
      • StartWebSession

      • External Evaluation Systems
      • Python
      • NodeJS
      • Julia
      • Ruby
      • R
      • Shell
      • Jupyter
      • SQL
      • SQL-JDBC
    • Related Guides
      • External Language Interfaces
      • Database Connectivity
      • Calling External Programs
      • External Interpreted Language Interfaces
      • Working with Information in Relational Databases
    • Workflows
      • Configure Python for ExternalEvaluate
      • Configure Node.js for ExternalEvaluate
      • Configure Julia for ExternalEvaluate
      • Configure Ruby for ExternalEvaluate
      • Execute a Python File with ExternalEvaluate

StartExternalSession["sys"]

starts an external session using the external evaluator sys, returning an external session object.

StartExternalSession[assoc]

starts the external evaluator specified by assoc.

StartExternalSession[obj]

starts the external evaluator specified by ExternalEvaluatorObject.

StartExternalSession[{"sys",opts}]

uses the options opts for the external evaluator.

StartExternalSession[systype]

specifies that output from the external evaluator should be converted to the specified type.

StartExternalSession[DatabaseReference[ref]]

uses the database specified by ref to start a database session.

Details
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Basic Uses  
Session Options  
"ReturnType"  
"Evaluator"  
"Name"  
"ID"  
"SessionProlog"  
"SessionEpilog"  
"Prolog"  
"Epilog"  
Properties & Relations  
See Also
Related Guides
Related Workflows
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • ExternalEvaluate
    • ExternalSessions
    • ExternalSessionObject
    • ExternalEvaluators
    • ExternalFunction
    • ExternalObject
    • StartProcess
    • DeleteObject
    • StartWebSession

    • External Evaluation Systems
    • Python
    • NodeJS
    • Julia
    • Ruby
    • R
    • Shell
    • Jupyter
    • SQL
    • SQL-JDBC
  • Related Guides
    • External Language Interfaces
    • Database Connectivity
    • Calling External Programs
    • External Interpreted Language Interfaces
    • Working with Information in Relational Databases
  • Workflows
    • Configure Python for ExternalEvaluate
    • Configure Node.js for ExternalEvaluate
    • Configure Julia for ExternalEvaluate
    • Configure Ruby for ExternalEvaluate
    • Execute a Python File with ExternalEvaluate
    • See Also
      • ExternalEvaluate
      • ExternalSessions
      • ExternalSessionObject
      • ExternalEvaluators
      • ExternalFunction
      • ExternalObject
      • StartProcess
      • DeleteObject
      • StartWebSession

      • External Evaluation Systems
      • Python
      • NodeJS
      • Julia
      • Ruby
      • R
      • Shell
      • Jupyter
      • SQL
      • SQL-JDBC
    • Related Guides
      • External Language Interfaces
      • Database Connectivity
      • Calling External Programs
      • External Interpreted Language Interfaces
      • Working with Information in Relational Databases
    • Workflows
      • Configure Python for ExternalEvaluate
      • Configure Node.js for ExternalEvaluate
      • Configure Julia for ExternalEvaluate
      • Configure Ruby for ExternalEvaluate
      • Execute a Python File with ExternalEvaluate

StartExternalSession   

Listing of External Evaluators »

StartExternalSession["sys"]

starts an external session using the external evaluator sys, returning an external session object.

StartExternalSession[assoc]

starts the external evaluator specified by assoc.

StartExternalSession[obj]

starts the external evaluator specified by ExternalEvaluatorObject.

StartExternalSession[{"sys",opts}]

uses the options opts for the external evaluator.

StartExternalSession[systype]

specifies that output from the external evaluator should be converted to the specified type.

StartExternalSession[DatabaseReference[ref]]

uses the database specified by ref to start a database session.

Details

  • StartExternalSession starts an external process that can be used to implement an external evaluator session in which there are multiple evaluations requested by ExternalEvaluate.
  • In StartExternalSession[assoc], elements of the association can include:
  • "System"the external system or language to start
    "Evaluator"the specific evaluator to execute code
    "Name"the registered name of an evaluator
    "ID"a unique identifier
    "ReturnType"type of object to return ("String", "Expression", ...)
    "Prolog"code to run before the command
    "Epilog"code to run after the command
    "SessionProlog"code to run before the session
    "SessionEpilog"code to run after the session
  • "System" is the only required key; all others are optional.
  • In StartExternalSession[sys], possible choices of sys include:
  • "Python"Python
    "NodeJS"JavaScript running through Node.js
    "Julia"Julia
    "Ruby"Ruby
    "R"R
    "Shell"Bash, Sh, Zsh, ...
    "Jupyter"Jupyter kernel
    "SQL"SQL database
    "SQL-JDBC"SQL database using JDBC
  • Possible settings for "type" in StartExternalSession[sys"type",…], or for "ReturnType", are dependent on the evaluation system, and typically include:
  • "Expression"attempt to convert to a Wolfram Language expression
    "String"give the raw string output by the external evaluator
  • The possible settings for evaluator in StartExternalSession[{sys,"Evaluator"evaluator},…] depend on sys, and include:
  • "path"path to a language executable
    DatabaseReference[…]an SQL database connection
    SQLConnection[…]an SQL-JDBC database connection
  • Typically, StartExternalSession uses the setting "ReturnType""Expression".
  • StartExternalSession[{"sys",opts}] is equivalent to StartExternalSession[<|"System""sys",opts|>].
  • StartExternalSession[{sys,"ID""id",…}] either returns an already running session with the given "id" or starts a new session with the unique "id".
  • ExternalEvaluators gives a list of evaluator systems that can be used.
  • ExternalSessions gives a list of active external sessions.
  • DeleteObject[ExternalSessionObject[…]] kills and removes an external session started by StartExternalSession.

Examples

open all close all

Basic Examples  (2)

Start an external Python session, automatically discovering any usable installations:

Evaluate code in the session:

Stop the session with DeleteObject:

Start a new Python session in a provisioned environment:

Scope  (16)

Basic Uses  (2)

Multiple external sessions can be run simultaneously:

Delete the session objects:

Start an external Python session using the executable in /usr/bin/python3:

Use the session for multiple calls to ExternalEvaluate:

Stop the session with DeleteObject:

Session Options  (14)

"ReturnType"  (4)

For most systems, the default return type is "Expression":

Delete the session objects:

Numbers, strings, lists and associations are automatically imported for the "Expression" return type:

Delete the session objects:

The return type of "String" returns a string of the result in the external language:

Delete the session objects:

When using a database, the default return type is "Dataset":

"ReturnType" can be used to return data in a different form:

Delete the session objects:

"Evaluator"  (3)

Evaluate code using a specified "Evaluator":

Delete the session objects:

An Association can be used to start a Python provisioned environment:

Use the session to evaluate the code:

Delete the session objects:

When using a File with the "SQL" evaluator, the target can be a path to an SQLite file or a DatabaseReference specification:

Delete the session objects:

"Name"  (1)

Register an evaluator using a name:

Start a session using the registered evaluator by referring to it by name:

Use the session:

Close the session:

"ID"  (1)

Start an evaluator with a given "ID":

The operation is idempotent; starting a session with the same "ID" will return the same running session:

You can check that there is only one running session, even if you run StartExternalSession two times:

Close the session:

"SessionProlog"  (2)

Use "SessionProlog" to perform a side effect at the start of a session:

Delete the session objects:

Start an external session and import a library at the beginning of the session:

Evaluate a function from the imported library:

Delete the session object:

"SessionEpilog"  (1)

Use "SessionEpilog" to perform a side effect at the end of a session:

Delete the session object:

"Prolog"  (1)

Use "Prolog" to perform a side effect before every evaluation:

Delete the session object:

"Epilog"  (1)

Use "Epilog" to perform a side effect after every evaluation:

Delete the session object:

Properties & Relations  (5)

Each session runs in its own process:

The process IDs for each session are different:

Delete the session objects:

If only the language is specified, when possible, an evaluator is automatically provisioned:

The evaluator is stored under $UserBaseDirectory:

Stop the session:

Use ExternalEvaluators to find all available evaluators for a system:

Use StartExternalSession to start a session from it:

Manually close the session:

Start a database session:

Run a query:

Manually close the session:

External language cells implicitly call StartExternalSession:

x=2

A new session has been started:

By default, all cells of a given system use that session:

x*x

End the session so that subsequent evaluations start in a new session:

See Also

ExternalEvaluate  ExternalSessions  ExternalSessionObject  ExternalEvaluators  ExternalFunction  ExternalObject  StartProcess  DeleteObject  StartWebSession

External Evaluation Systems: Python  NodeJS  Julia  Ruby  R  Shell  Jupyter  SQL  SQL-JDBC

Related Guides

    ▪
  • External Language Interfaces
  • ▪
  • Database Connectivity
  • ▪
  • Calling External Programs
  • ▪
  • External Interpreted Language Interfaces
  • ▪
  • Working with Information in Relational Databases

Related Workflows

    Related Workflows
    ▪
  • Configure Python for ExternalEvaluate
  • ▪
  • Configure Node.js for ExternalEvaluate
  • ▪
  • Configure Julia for ExternalEvaluate
  • ▪
  • Configure Ruby for ExternalEvaluate
  • ▪
  • Execute a Python File with ExternalEvaluate

History

Introduced in 2017 (11.2) | Updated in 2024 (14.1)

Wolfram Research (2017), StartExternalSession, Wolfram Language function, https://reference.wolfram.com/language/ref/StartExternalSession.html (updated 2024).

Text

Wolfram Research (2017), StartExternalSession, Wolfram Language function, https://reference.wolfram.com/language/ref/StartExternalSession.html (updated 2024).

CMS

Wolfram Language. 2017. "StartExternalSession." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/StartExternalSession.html.

APA

Wolfram Language. (2017). StartExternalSession. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/StartExternalSession.html

BibTeX

@misc{reference.wolfram_2025_startexternalsession, author="Wolfram Research", title="{StartExternalSession}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/StartExternalSession.html}", note=[Accessed: 04-February-2026]}

BibLaTeX

@online{reference.wolfram_2025_startexternalsession, organization={Wolfram Research}, title={StartExternalSession}, year={2024}, url={https://reference.wolfram.com/language/ref/StartExternalSession.html}, note=[Accessed: 04-February-2026]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English