Deploy your Tailor Platform application to a workspace. This command builds your application, compares it with the deployed state, and applies all necessary changes to services, resources, and schemas.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tailor-platform/sdk/llms.txt
Use this file to discover all available pages before exploring further.
Command Syntax
Options
Workspace ID to deploy to. Can also be set via
TAILOR_PLATFORM_WORKSPACE_ID environment variable or workspace profile.Alias: -wWorkspace profile name. Profiles store workspace ID and authentication token for easy switching between environments.Alias:
-pPath to SDK config file.Alias:
-cSkip confirmation prompts and apply changes automatically.Alias:
-yRun the command without making any changes. Useful for previewing what would be deployed.Alias:
-dSkip schema diff check against migration snapshots. Not recommended for production deployments.
Disable bundle caching for this run. Forces a complete rebuild of all function bundles.
Clean the bundle cache before building. Useful when experiencing caching issues.
Common Options
The following common options are also available:--env-file/-e- Path to environment file (error if not found)--env-file-if-exists- Path to environment file (ignored if not found)--verbose- Enable verbose logging (show stack traces on error)--json/-j- Output as JSON (where applicable)
Usage Examples
Basic Deploy
Deploy with Profile
Deploy without Confirmation
Dry Run
Deploy with Environment Variables
Clean Cache and Deploy
Apply Phases
Theapply command executes in multiple phases:
Phase 0: Build
- Loads configuration from
tailor.config.ts - Generates user types
- Bundles functions (workflows, executors, resolvers)
- Caches bundles for faster subsequent builds
Phase 1: Plan
Compares local configuration with deployed resources:- Function registry entries
- TailorDB services and types
- Static websites
- Identity providers
- Auth services and OAuth2 clients
- Resolvers and pipelines
- Applications
- Executors
- Workflows
Phase 1b: Confirm
Prompts for confirmation when:- Resource ownership conflicts detected
- Unmanaged resources found in workspace
- Important resources will be deleted (types, OAuth2 clients, static websites)
Phase 2-9: Apply Changes
Applies changes in dependency order:- Create/Update Services - Services that Application depends on
- Delete Subgraph Resources - Types, resolvers before Application update
- Create/Update Application - Main application resource
- Create/Update Dependent Services - Executors and Workflows
- Delete Dependent Services - Workflows, Executors, Static Websites
- Delete Application - Removed applications
- Delete Subgraph Services - After Application is deleted
- Cleanup - Delete unused function registry entries
The multi-phase approach ensures resources are created and deleted in the correct order to maintain referential integrity.
Migration Handling
When migrations are configured viadb.tailordb.migration, the apply command automatically:
- Detects pending migration scripts that haven’t been executed
- Applies schema changes in a safe order:
- Pre-migration schema changes
- Script execution via TestExecScript API
- Post-migration schema changes
- Updates migration state labels in TailorDB metadata
Schema Check
By default,apply performs two verification steps:
Local Schema Check
Verifies that local schema changes match the migration files. This ensures migrations are properly generated before deployment.Remote Schema Check
Verifies that the remote schema matches the expected state based on migration history. This detects schema drift caused by:- Manual changes in the console
- Deployments from other developers
- Out-of-sync migration state
Bundle Caching
Theapply command caches function bundles to improve build performance:
- Cache key includes SDK version and lockfile hash
- Only changed functions are rebuilt
- Cache persists across runs
- Use
--no-cacheto disable - Use
--clean-cacheto clear and rebuild
Authentication
Authentication token priority:TAILOR_PLATFORM_TOKENenvironment variableTAILOR_TOKENenvironment variable (deprecated)- Profile specified via
--profileorTAILOR_PLATFORM_PROFILE - Current user from platform config (
~/.config/tailor-platform/config.yaml)
Workspace ID Resolution
Workspace ID priority:--workspace-idcommand optionTAILOR_PLATFORM_WORKSPACE_IDenvironment variable- Profile specified via
--profileorTAILOR_PLATFORM_PROFILE
Output Example
Related Commands
generate- Generate files from configurationremove- Remove application from workspaceshow- Show deployed application infotailordb migration generate- Generate migration files