Skip to main content

When to use

  • Promote a deployed use case from dev to production
  • Make a process available to end users for the first time
  • Configure visibility (private, organizational, public) on first publish
  • Enable dev/prod auto-toggle to pause dev when prod is running

Prerequisites

  • codika CLI installed and authenticated
  • A deployed use case with project.json containing a deployments map (run deploy use-case first)
  • API key with deploy:use-case scope

Command

Arguments

Options

Finding the template ID

After each deploy, project.json stores a deployments map keyed by version:
Use the templateId from the version you want to publish.

What happens on publish

  1. Resolve project ID: --project-id > --project-file > project.json
  2. Resolve API key: --api-key > env > active profile
  3. Send publish request to platform with templateId, projectId, and options
  4. Platform publishes the deployment template (status: inactive → published)
  5. Platform deprecates any previously published templates for this project
  6. Platform auto-creates or updates the owner’s prod process instance
  7. If --auto-toggle-dev-prod, deactivates dev instance
  8. On success: saves prodProcessInstanceId to project.json

Visibility

Set on first publish only. Subsequent publishes inherit the existing visibility.

Shared with

Controls who can use the prod instance. Applies to organizational processes only.

Dev/Prod toggle

By default, both dev and prod instances run simultaneously. Use --auto-toggle-dev-prod to pause the dev instance when production becomes active:
This keeps production as the single active instance, avoiding duplicate executions from scheduled or webhook triggers. To disable the toggle after publishing, re-publish without the flag or update the setting in the platform UI.

Examples

Output

Need to change parameters without a new version? After publishing, use codika rerun deployment to update deployment parameters on the prod instance without creating a new template version. Only the parameters you specify are changed — everything else stays the same.

Error reference

Exit codes