Skip to content

Examples

Working examples demonstrating functualize features in realistic scenarios. Each example is self-contained, reproducible, and (where automatable) includes tests proving it works.

The examples are organized into four categories matching different usage patterns. View the full source at examples/.

Quickstart (The README, Runnable)

  • Quickstart Steps 1–8 — every step of the README Quick Start as runnable code: script → config → invoke → inline TUI → AI → MCP → workflows → scaffold.

Standalone (Feature Reference)

Run jobs with the func CLI, no project structure needed.

  • Hello World — Single-file jobs (Mode A). One file, multiple functions, one command.
  • Inline Dependencies — Jobs using Domain SDK packages (state, tasks) directly in a single file.
  • AI Inbound — A job driven by an external AI agent via the AI_INBOUND gate strategy.
  • AI Outbound — A job that calls an LLM using the AI capability for content generation.

Also in the repo (source-only): showcase/ (the all-in-one project: CLI modes, inline TUI scenarios, surfaces, config inspector, AI jobs), discovery_lab/ (all six discovery filters + global dirs from one jobs tree, plus a programmatic pre_filter), config_lab/ (the config precedence chain), secrets_lab/ (declaring a credential with Secret[str], and what every surface renders for it), group_options_lab/ (flags that belong to a group rather than a job, typed mid-path), and deploy_tool/ (an app that is not func: its own command name, config table and env prefix), and composition_lab/ (every combination matrix in the Composing Capabilities guide, executed by examples/docs/scenarios/n-composition.toml), and freshness_lab/ (a job that caches its own artifact: Fingerprint(decides=True) plus the Freshness verdict, beside the control job the framework skips instead).

Project (Full Applications)

  • weather_app/ — the flagship: the Quick Start jobs as a scaffolded project with an entry point and layered config.
  • monorepo_children/ — one parent app mounting child projects as namespaced job groups.
  • shared_plugins/ — one file-based plugin shared by every app under a root, and one app opting into an extra plugins_directories its siblings do not get.

Delivery-adapter projects live with their plugins:

  • HTTP Service — Expose jobs as an HTTP API using the functualize-http adapter.
  • Lambda Handler — Deploy jobs to AWS Lambda with fat and thin Lambda patterns.

Plugins (Extending Functualize)

Create your own plugins and adapters for the ecosystem.

  • Custom Substrate — Implement the StoreSubstrate port: bring your own storage.
  • Custom Adapter — Implement the AdapterPlugin protocol for webhook delivery.
  • File-Based Plugin — Zero packaging: a single .py file in .functualize/plugins/.

Every first-party plugin also ships usage examples in its own folder: plugins/<name>/examples/.

Dev Container

All examples can be run in isolation using the provided Dev Container configuration. Open in VS Code with Dev Containers or GitHub Codespaces for a zero-setup experience.

# Or run locally from the repo root
uv sync --all-packages
uv run pytest examples/ -v