compute_submit
Submit a Python function for remote execution on a Globus Compute endpoint and receive a task ID for asynchronous tracking.
Instructions
Submit a Python function for remote execution on a Globus Compute endpoint.
The function is provided as Python source code. All imports MUST be inside the function body. The function is registered, then submitted asynchronously — this tool returns immediately with a task ID.
IMPORTANT: If your function uses any third-party packages, you MUST provide a 'requirements' string listing them (one per line, like a requirements.txt). This is used to provision a virtual environment on the remote endpoint automatically.
Args: endpoint_id: UUID of the target Compute endpoint. Use compute_endpoint_list() to find available endpoints. function_source: Python source code containing the function. Example: "def analyze(data_path):\n import pandas as pd\n ..." function_name: Name of the function defined in function_source. requirements: Newline-separated pip requirements for the function's dependencies (e.g. "numpy\npandas>=2.0\nscipy"). Omit if the function only uses the standard library. args: Positional arguments to pass to the function. kwargs: Keyword arguments to pass to the function. python_version: Python version for the remote venv (e.g. "3.12"). Defaults to the version running in this server. user_endpoint_config: Additional endpoint configuration. If this contains a 'worker_init' key, it overrides the auto-generated worker_init from requirements.
Returns: Dict with 'task_ids' (list of task UUID strings) and 'function_id'.
Examples: compute_submit( endpoint_id="abcd-1234-...", function_source="def hello():\n return 'Hello from HPC!'", function_name="hello", )
compute_submit(
endpoint_id="abcd-1234-...",
function_source="def analyze(n):\n import numpy as np\n return np.random.rand(n).mean()",
function_name="analyze",
requirements="numpy",
args=[1000],
)Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endpoint_id | Yes | ||
| function_source | Yes | ||
| function_name | Yes | ||
| requirements | No | ||
| args | No | ||
| kwargs | No | ||
| python_version | No | ||
| user_endpoint_config | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||