Overview
TheBaseApplication class is the central orchestration component of the Atlan Application SDK. It provides a standardized way to set up and run applications that use Temporal workflows, including automatic configuration of workflow clients, workers, and FastAPI servers.
The
BaseApplication is designed to be used directly for most applications. For specialized use cases, you can subclass it to add custom functionality.Key Features
- Unified Workflow Management: Single interface for managing workflows, workers, and servers
- Multi-Mode Deployment: Support for local development, worker-only, and server-only modes
- Event-Based Workflows: Built-in support for event subscriptions and triggers
- MCP Integration: Optional Model Context Protocol (MCP) server support
- Application Manifest: Configuration-driven event registration
Initialization
Constructor Parameters
The name of the application. Used for workflow client identification and logging.
The server instance for the application. Typically an
APIServer instance.Application manifest configuration containing event registration and other settings.
Client class for the application. Must inherit from
BaseClient.Handler class for the application. Must inherit from
BaseHandler.Core Methods
setup_workflow()
Set up the workflow client and initialize the worker with workflows and activities.workflow_and_activities_classes
List[Tuple[Type[WorkflowInterface], Type[ActivitiesInterface]]]
required
List of tuples pairing workflow classes with their corresponding activities classes.
List of module names to pass through to the worker sandbox. These modules will be accessible within workflows.
Custom thread pool executor for running activities. If not provided, a default executor is created.
start()
Start the application based on the configuredAPPLICATION_MODE environment variable.
The main workflow class to register with the server.
Whether to enable the UI frontend routes.
Whether the application has a configuration map for the UI.
start_workflow()
Manually start a new workflow execution.Arguments to pass to the workflow execution.
The workflow class to execute.
Deployment Modes
The SDK supports three deployment modes via theAPPLICATION_MODE environment variable:
LOCAL Mode
LOCAL Mode
Use case: Local developmentStarts both the worker (in daemon mode) and the server in a single process. The worker runs in the background while the server handles API requests.
WORKER Mode
WORKER Mode
Use case: Production worker podsStarts only the worker in non-daemon mode. This is the mode to use for dedicated worker containers in production.
SERVER Mode
SERVER Mode
Use case: Production API server podsStarts only the FastAPI server without a worker. Use this for API-only containers that trigger workflows but don’t execute them.
Event Registration
Register event-based workflow triggers using the application manifest and registration API.Complete Example
Instance Attributes
| Attribute | Type | Description |
|---|---|---|
application_name | str | Name of the application |
server | Optional[ServerInterface] | Server instance for handling HTTP requests |
worker | Optional[Worker] | Worker instance for executing workflows |
workflow_client | WorkflowClient | Client for interacting with Temporal |
application_manifest | Optional[Dict[str, Any]] | Application configuration manifest |
event_subscriptions | Dict[str, EventWorkflowTrigger] | Registered event subscriptions |
client_class | Type[BaseClient] | Client class for the application |
handler_class | Type[BaseHandler] | Handler class for the application |
mcp_server | Optional[MCPServer] | MCP server instance (if MCP is enabled) |
Related Components
- Workflows - Define workflow logic
- Activities - Implement workflow tasks
- Workers - Execute workflows and activities
- Server - Handle API requests