Skip to main content

fused run

Run a UDF and print the result to stdout.

fused run CANVAS UDF [OPTIONS] [--<param>=<value> ...]

CANVAS is the canvas collection context. Use "" for standalone local files. UDF is passed to fused.load and accepts:

  • A local Python file: udf.py
  • A Fused identifier: user@example.com/my_udf or my_udf (resolved against CANVAS)
  • A GitHub URL: https://github.com/org/repo/blob/main/udf.py
  • Inline source: a string containing at least one newline is treated as Python module text

Options

FlagDescription
--engine [remote|local]Run on Fused servers (remote, default) or locally
--instance-type TEXTRemote instance type override
--cache-max-age TEXTMax age for cached results, e.g. 10s, 5m, 1h
--no-cacheBypass the cache entirely
--disk-size-gb INTEGERRemote disk size override
--max-retry INTEGERNumber of retries on failure
--verbose / --no-verboseShow UDF stdout/stderr (on by default)
--stdinRead UDF source from stdin instead of UDF argument

Passing UDF parameters

Any extra --key=value flags are forwarded directly to the UDF as keyword arguments, matching the UDF's function signature:

fused run "" udf.py --bbox="-122.5,37.5,-122.0,38.0" --zoom=12

Examples

# Run a local UDF
fused run "" udf.py

# Run locally (no network call)
fused run "" udf.py --engine local

# Pass parameters to the UDF
fused run "" udf.py --city="San Francisco" --limit=100

# Run a UDF from a Fused canvas
fused run my_canvas my_udf

# Run from a GitHub URL
fused run "" https://github.com/fusedio/udfs/blob/main/public/DuckDB_H3_Example/DuckDB_H3_Example.py

# Pipe UDF source from stdin
cat udf.py | fused run "" --stdin

# Skip cache
fused run "" udf.py --no-cache
tip

Run fused udf-schema "" udf.py first to see the UDF's parameter names and types before passing --key=value arguments.