### Install SQLite Schema and Start Server Source: https://github.com/cadence-workflow/cadence/blob/master/CLAUDE.md Command to install the SQLite schema and start the Cadence server locally without Docker for quick development. ```bash make install-schema-sqlite ./cadence-server --zone sqlite start ``` -------------------------------- ### Install Cadence Schema Source: https://github.com/cadence-workflow/cadence/blob/master/service/worker/README.md After starting dependencies, run this command to install the necessary schemas for Cadence. ```bash make install-schema-xdc ``` -------------------------------- ### Build Cadence Binaries from Source Source: https://context7.com/cadence-workflow/cadence/llms.txt Builds all Cadence tools including the server, CLI, benchmark, and canary binaries. Requires Go 1.24+ and make. After building, install the database schema (defaulting to Cassandra) and start the local server. ```bash # Prerequisites: Go 1.24+, make git clone https://github.com/cadence-workflow/cadence.git cd cadence # Build all tools: server, CLI, bench, canary make cadence # builds ./cadence CLI binary make cadence-server # builds ./cadence-server binary make cadence-bench # builds ./cadence-bench binary make cadence-canary # builds ./cadence-canary binary # Install database schema (Cassandra, default) make install-schema # Install schema for MySQL make install-schema-mysql # Install schema for PostgreSQL make install-schema-postgres # Start the server locally (Cassandra backend) ./cadence-server start --services=frontend,matching,history,worker ``` -------------------------------- ### Start Cadence Server Instances Source: https://github.com/cadence-workflow/cadence/blob/master/docs/howtos/setup-cadence-locally-with-replication.md Starts individual Cadence server instances, each configured for a specific zone and environment, suitable for a multi-cluster setup. ```bash ./cadence-server --config config --zone xdc --env development_xdc_cluster0 start ``` ```bash ./cadence-server --config config --zone xdc --env development_xdc_cluster1 start ``` ```bash ./cadence-server --config config --zone xdc --env development_xdc_cluster2 start ``` -------------------------------- ### Install Cassandra and OpenSearch Schemas Source: https://github.com/cadence-workflow/cadence/blob/master/CONTRIBUTING.md Run these commands to install schemas for Cassandra and OpenSearch. ```bash make install-schema && make install-schema-es-opensearch ``` -------------------------------- ### Start Cadence Backend Locally Source: https://github.com/cadence-workflow/cadence/blob/master/README.md Use this command to start the Cadence backend components locally using Docker Compose. Ensure Docker is installed and running. ```bash docker compose -f docker/docker-compose.yml up ``` -------------------------------- ### Install Cassandra Schemas Source: https://github.com/cadence-workflow/cadence/blob/master/CONTRIBUTING.md Run this command to install schemas for Cassandra. ```bash make install-schema ``` -------------------------------- ### Install Cassandra with Homebrew Source: https://github.com/cadence-workflow/cadence/blob/master/docs/persistence.md Use Homebrew to install Cassandra on macOS. ```bash brew install cassandra brew services start cassandra ``` -------------------------------- ### Example Scanner/Fixer Setup - Dynamic Configuration Source: https://github.com/cadence-workflow/cadence/blob/master/service/worker/scanner/README.md This YAML configuration enables specific invariants for both the executions scanner and fixer. These settings control which invariants are active during the scanning and fixing processes. ```yaml # enable these invariants worker.executionsScannerInvariantCollectionStale: - value: true # default false worker.executionsScannerInvariantCollectionMutableState: - value: true # default true worker.executionsScannerInvariantCollectionHistory: - value: true # default true worker.executionsFixerInvariantCollectionStale: - value: true # default false worker.executionsFixerInvariantCollectionMutableState: - value: true # default true worker.executionsFixerInvariantCollectionHistory: - value: true # default true ``` -------------------------------- ### Start Cadence Server for Cross-Region Setup Source: https://github.com/cadence-workflow/cadence/blob/master/service/worker/README.md Starts a Cadence server for a cross-region setup. This configuration is suitable for high network latency between clusters. ```bash ./cadence-server --zone cross_region_cluster0 start ``` ```bash ./cadence-server --zone cross_region_cluster1 start ``` ```bash ./cadence-server --zone cross_region_cluster2 start ``` -------------------------------- ### Start Local Cadence Server with Cassandra Source: https://github.com/cadence-workflow/cadence/blob/master/CONTRIBUTING.md Starts the local Cadence server using the default Cassandra configuration. ```bash ./cadence-server start ``` -------------------------------- ### Example Scanner/Fixer Setup - Stale Workflow Check Source: https://github.com/cadence-workflow/cadence/blob/master/service/worker/scanner/README.md This Go code demonstrates how to modify the `Check` method of a stale workflow invariant to always return a corrupted result for testing purposes. The `Fix` method would then run the real check. ```go func (c *staleWorkflowCheck) Check( ctx context.Context, execution interface{ }, ) CheckResult { x := true if x { return CheckResult{ CheckResultType: CheckResultTypeCorrupted, InvariantName: c.Name(), Info: "fake corrupt", } } _, result := c.check(ctx, execution) return result } ``` -------------------------------- ### Start Local Cadence Server with Cassandra and OpenSearch Source: https://github.com/cadence-workflow/cadence/blob/master/CONTRIBUTING.md Starts the local Cadence server using Cassandra and OpenSearch configuration. ```bash ./cadence-server --zone es_opensearch start ``` -------------------------------- ### Start Local Cadence Server with MySQL Source: https://github.com/cadence-workflow/cadence/blob/master/CONTRIBUTING.md Starts the local Cadence server using MySQL configuration. ```bash ./cadence-server --zone mysql start ``` -------------------------------- ### Install Cadence CLI with Homebrew Source: https://github.com/cadence-workflow/cadence/blob/master/README.md Install the Cadence CLI using Homebrew. Follow the provided instructions if you need to install older versions of the CLI. ```bash brew install cadence-workflow ``` -------------------------------- ### Start Local Cadence Server with PostgreSQL Source: https://github.com/cadence-workflow/cadence/blob/master/CONTRIBUTING.md Starts the local Cadence server using PostgreSQL configuration. ```bash ./cadence-server --zone postgres start ``` -------------------------------- ### Start Local Cadence Server with SQLite Source: https://github.com/cadence-workflow/cadence/blob/master/CONTRIBUTING.md Starts the local Cadence server using SQLite configuration. ```bash ./cadence-server --zone sqlite start ``` -------------------------------- ### Install Go with Homebrew Source: https://github.com/cadence-workflow/cadence/blob/master/CONTRIBUTING.md Use Homebrew to install the Go programming language on macOS. ```bash brew install go ``` -------------------------------- ### Start Docker Compose for Cadence Development Source: https://github.com/cadence-workflow/cadence/blob/master/service/worker/README.md Use this command to start Cadence dependencies using Docker Compose for local development. Ensure you have Docker installed. ```bash docker compose -f docker/dev/cassandra.yml up ``` -------------------------------- ### Start Helloworld Workflow Source: https://github.com/cadence-workflow/cadence/blob/master/CONTRIBUTING.md Executes the Helloworld workflow. This should be run after the worker has been started. ```bash ./bin/helloworld ``` -------------------------------- ### Start Cadence Server with Cassandra Source: https://github.com/cadence-workflow/cadence/blob/master/docs/persistence.md Starts the Cadence server with frontend, matching, history, and worker services enabled. ```bash cd $GOPATH/github.com/cadence-workflow/cadence ./cadence-server start --services=frontend,matching,history,worker ``` -------------------------------- ### Start Cadence Server from Source Source: https://github.com/cadence-workflow/cadence/blob/master/canary/README.md Build and run the Cadence server from source. Ensure Kafka and Elasticsearch are running before starting the server. Adjust the zone flag if using Elasticsearch v7. ```bash ./cadence-server --zone es start ``` ```bash ./cadence-server --zone es_v7 start ``` -------------------------------- ### Install SQLite Schemas Source: https://github.com/cadence-workflow/cadence/blob/master/CONTRIBUTING.md Run this command to install schemas if you are using SQLite. ```bash make install-schema-sqlite ``` -------------------------------- ### Install Cadence Schema for XDC Source: https://github.com/cadence-workflow/cadence/blob/master/docs/howtos/setup-cadence-locally-with-replication.md Installs the necessary schema for Cadence on Cassandra. It loops until the schema installation is complete, accounting for potential delays in Cassandra startup. ```bash until make install-schema-xdc; do sleep 1; done ``` -------------------------------- ### Install PostgreSQL with Homebrew Source: https://github.com/cadence-workflow/cadence/blob/master/docs/persistence.md Use Homebrew to install PostgreSQL on macOS. ```bash brew install postgres brew services start postgres ``` -------------------------------- ### Install Cassandra and ElasticSearch v7 Schemas Source: https://github.com/cadence-workflow/cadence/blob/master/CONTRIBUTING.md Run these commands to install schemas for Cassandra and ElasticSearch v7. ```bash make install-schema && make install-schema-es-v7 ``` -------------------------------- ### Install MySQL Schemas Source: https://github.com/cadence-workflow/cadence/blob/master/CONTRIBUTING.md Run this command to install schemas if you are using MySQL. ```bash install-schema-mysql ``` -------------------------------- ### Run Cadence Components via Docker Compose Source: https://github.com/cadence-workflow/cadence/blob/master/docs/howtos/cassandra-fql.md Starts the necessary Cadence services using Docker Compose. Ensure you have Docker installed and the `docker-compose.yml` file present. ```bash docker compose docker/docker-compose.yml up ``` -------------------------------- ### Start Cadence Server with MySQL Source: https://github.com/cadence-workflow/cadence/blob/master/docs/persistence.md Starts the Cadence server using a MySQL backend. Requires copying the development configuration for MySQL. ```bash cd $GOPATH/github.com/cadence-workflow/cadence cp config/development_mysql.yaml config/development.yaml ./cadence-server start --services=frontend,matching,history,worker ``` -------------------------------- ### Start Helloworld Worker Source: https://github.com/cadence-workflow/cadence/blob/master/CONTRIBUTING.md Starts a worker process for the Helloworld workflow. Ensure this is running before starting the workflow. ```bash ./bin/helloworld -m worker & ``` -------------------------------- ### Install PostgreSQL Schemas Source: https://github.com/cadence-workflow/cadence/blob/master/CONTRIBUTING.md Run this command to install schemas if you are using PostgreSQL. ```bash install-schema-postgres ``` -------------------------------- ### Start Cadence Server with PostgreSQL Source: https://github.com/cadence-workflow/cadence/blob/master/docs/persistence.md Starts the Cadence server using a PostgreSQL backend. Requires copying the development configuration for PostgreSQL. ```bash cd $GOPATH/github.com/cadence-workflow/cadence cp config/development_postgres.yaml config/development.yaml ./cadence-server start --services=frontend,matching,history,worker ``` -------------------------------- ### Install MySQL with Homebrew Source: https://github.com/cadence-workflow/cadence/blob/master/docs/persistence.md Use Homebrew to install MySQL on macOS. ```bash brew install mysql brew services start mysql ``` -------------------------------- ### Start Local Cadence Server with Cassandra and ElasticSearch v7 Source: https://github.com/cadence-workflow/cadence/blob/master/CONTRIBUTING.md Starts the local Cadence server using Cassandra and ElasticSearch v7 configuration. ```bash ./cadence-server --zone es_v7 start ``` -------------------------------- ### Start Local Cadence Server with Multiple MySQL Source: https://github.com/cadence-workflow/cadence/blob/master/CONTRIBUTING.md Starts the local Cadence server using multiple MySQL instances configuration. ```bash ./cadence-server --zone multiple_mysql start ``` -------------------------------- ### Install Cadence Schema for Cassandra Source: https://github.com/cadence-workflow/cadence/blob/master/docs/persistence.md Installs the necessary database schema for Cadence when using Cassandra. ```bash cd $GOPATH/github.com/cadence-workflow/cadence make install-schema ``` -------------------------------- ### Start Cassandra Dependency with Docker Compose Source: https://github.com/cadence-workflow/cadence/blob/master/CONTRIBUTING.md Use Docker Compose to start a Cassandra instance for development. Use `up -d` to run in detached mode. ```bash docker compose -f ./docker/dev/cassandra.yml up # Or to run in the background docker compose -f ./docker/dev/cassandra.yml up -d ``` -------------------------------- ### Install Multiple MySQL Schemas Source: https://github.com/cadence-workflow/cadence/blob/master/CONTRIBUTING.md Run this command to install schemas for multiple MySQL databases. ```bash make install-schema-multiple-mysql ``` -------------------------------- ### Install Cassandra Schema for Cadence Source: https://context7.com/cadence-workflow/cadence/llms.txt Installs and sets up the Cassandra schema for a new Cadence deployment. Requires specifying the keyspace and replication factor. ```bash # --- Cassandra --- # Install schema for new deployment cadence-cassandra-tool --ep 127.0.0.1 create --keyspace cadence --replication_factor 1 cadence-cassandra-tool --ep 127.0.0.1 --keyspace cadence setup-schema -v 0.0 cadence-cassandra-tool --ep 127.0.0.1 --keyspace cadence update-schema \ --schema-dir /usr/local/etc/cadence/schema/cassandra/cadence/versioned ``` -------------------------------- ### Start Workflow with Search Attributes using Cadence CLI Source: https://github.com/cadence-workflow/cadence/blob/master/docs/visibility-on-elasticsearch.md Initiate a workflow using `cadence workflow start` and specify custom search attributes with `-search_attr_key` and `-search_attr_value`. Workflows started without Elasticsearch will not be searchable. ```bash cadence --do samples-domain workflow start --tl helloWorldGroup --wt main.Workflow --et 60 --dt 10 -i '"input arg"' -search_attr_key 'CustomIntField | CustomKeywordField | CustomStringField | CustomBoolField | CustomDatetimeField' -search_attr_value '5 | keyword1 | my test | true | 2019-06-07T16:16:36-08:00' ``` -------------------------------- ### Start Cadence Canary with Docker Compose Source: https://context7.com/cadence-workflow/cadence/llms.txt Starts the Cadence canary using Docker Compose. This is an alternative to building and running the binary directly. ```bash docker compose -f docker/docker-compose-canary.yml up ``` -------------------------------- ### Install Single MySQL and ElasticSearch v7 Schemas Source: https://github.com/cadence-workflow/cadence/blob/master/CONTRIBUTING.md Run these commands to install schemas for a single MySQL instance and ElasticSearch v7. ```bash install-schema-mysql && make install-schema-es-v7 ``` -------------------------------- ### Extract and Start Cadence with Released Image Source: https://github.com/cadence-workflow/cadence/blob/master/docker/README.md Extract a pre-built Cadence Docker image and its startup scripts from a downloaded `docker.tar.gz` file, then start the service using Docker Compose. This is for using stable, released versions. ```bash tar -xzvf docker.tar.gz cd docker docker compose up ``` -------------------------------- ### Start Basic Cadence Workflow via CLI Source: https://context7.com/cadence-workflow/cadence/llms.txt Starts a basic workflow with specified parameters and input payload. Ensure the Cadence service is accessible at the given address. ```bash cadence --address 127.0.0.1:7933 \ workflow start \ --domain cadence-bench \ --tasklist cadence-bench-tasklist \ --workflow_type basic \ --execution_timeout 600 \ --input '{ "testName": "basic", "totalLaunchCount": 1000, "routineCount": 10, "chainSequence": 5, "concurrentCount": 2, "payloadSizeBytes": 128, "minCadenceSleepInSeconds": 0, "maxCadenceSleepInSeconds": 1 }' ``` -------------------------------- ### Start Query Workflow Test Source: https://github.com/cadence-workflow/cadence/blob/master/canary/README.md Manually start a run of the Query workflow test case to test the Query feature. ```bash cadence --do <> workflow start --tl canary-task-queue --et 10 --wt workflow.query -i 0 ``` -------------------------------- ### Setup Initial Schema with SQL Tool Source: https://github.com/cadence-workflow/cadence/blob/master/tools/sql/README.md Sets up the initial schema version tables for Cadence and Cadence Visibility databases. Use '-v 0.0' for the initial version. ```bash ./cadence-sql-tool --ep $SQL_HOST_ADDR -p $port --plugin mysql --db cadence setup-schema -v 0.0 -- this sets up just the schema version tables with initial version of 0.0 ``` ```bash ./cadence-sql-tool --ep $SQL_HOST_ADDR -p $port --plugin mysql --db cadence_visibility setup-schema -v 0.0 -- this sets up just the schema version tables with initial version of 0.0 for visibility ``` -------------------------------- ### Start Cadence Server with Docker Compose (Elasticsearch) Source: https://github.com/cadence-workflow/cadence/blob/master/canary/README.md Use this command to start a Cadence server cluster locally with Elasticsearch support using Docker Compose. Ensure Kafka is also running. ```bash docker compose -f docker-compose-es.yml up ``` -------------------------------- ### Basic Session Usage Example Source: https://github.com/cadence-workflow/cadence/blob/master/docs/design/1533-host-specific-tasklist.md Demonstrates the typical lifecycle of a session, including creation, deferring completion, and executing activities. It also includes basic error handling for session or activity failures. ```go sessionCtx, err := CreateSession(ctx) if err != nil { // Creation failed. Wrong ctx or too many outstanding sessions. } defer CompleteSession(sessionCtx) err = ExecuteActivity(sessionCtx, DownloadFileActivity, filename).Get(sessionCtx, nil) if err != nil { // Session(worker) has failed or activity itself returns an error. // User can perform normal error handling here and decide whether creating a new session is needed. // If they decide to create a new session, they need to call CompleteSession() so that worker resources can be released. We recommend that users create a function for a session and call defer CompleteSession(sessionCtx) after a session is created. If session retry is needed, this function can be called multiple times if the error returned is retriable. } err = ExecuteActivity(sessionCtx, ProcessFileActivity, filename).Get(sessionCtx, nil) if err != nil { // Session(worker) has failed or activity itself returns an error. } err = ExecuteActivity(sessionCtx, UploadFileActivity, filename).Get(sessionCtx, nil) if err != nil { // Session(worker) has failed or activity itself returns an error. } ``` -------------------------------- ### Build All Samples Source: https://github.com/cadence-workflow/cadence/blob/master/CONTRIBUTING.md Run this command to build all sample applications for Cadence. ```bash make bins ``` -------------------------------- ### Start Cadence Server with Docker Compose (Elasticsearch v7) Source: https://github.com/cadence-workflow/cadence/blob/master/canary/README.md Use this command to start a Cadence server cluster locally with Elasticsearch v7 support using Docker Compose. Ensure Kafka is also running. ```bash docker compose -f docker-compose-es-v7.yml up ``` -------------------------------- ### Start Cassandra with XDC Configuration Source: https://github.com/cadence-workflow/cadence/blob/master/docs/howtos/setup-cadence-locally-with-replication.md Starts Cassandra containers in detached mode using the provided Docker Compose file for cross-datacenter replication setup. ```bash docker compose -f docker/dev/cassandra.yml up -d ``` -------------------------------- ### Setup Initial Schema Version Tables Source: https://github.com/cadence-workflow/cadence/blob/master/tools/cassandra/README.md Sets up the schema version tables for the Cadence and visibility keyspaces with an initial version of 0.0. This is a prerequisite before updating to the latest schema versions. ```bash ./cadence-cassandra-tool -ep 127.0.0.1 -k cadence setup-schema -v 0.0 ``` ```bash ./cadence-cassandra-tool -ep 127.0.0.1 -k cadence_visibility setup-schema -v 0.0 ``` -------------------------------- ### Start Local Cadence Cluster with Async Workflow Kafka Enabled Source: https://github.com/cadence-workflow/cadence/blob/master/docs/howtos/async-api.md Starts a local Cadence cluster with Kafka support for asynchronous workflows. Ensure Kafka seeds and port are correctly configured in the environment variables. ```bash docker compose -f docker/docker-compose-async-wf-kafka.yml up ``` -------------------------------- ### Build and Run Cadence Bench Binary Source: https://github.com/cadence-workflow/cadence/blob/master/bench/README.md Build the cadence bench binary from the project root and then start the bench worker. It will load the default configuration from `config/bench/development.yaml`. ```bash make cadence-bench ``` ```bash ./cadence-bench start ``` -------------------------------- ### Start Cadence Canary Worker and Cron Source: https://github.com/cadence-workflow/cadence/blob/master/canary/README.md Start the Cadence canary worker and cron services using the built binary. This command is equivalent to starting in 'all' mode. ```bash ./cadence-canary start ``` ```bash ./cadence-canary start -mode all ``` -------------------------------- ### Build and Start Cadence Canary Source: https://context7.com/cadence-workflow/cadence/llms.txt Builds the canary binary and starts it. The canary runs periodic workflow tests to validate cluster health. It can be started in worker-only or cron-scheduler-only modes. ```bash # Build and start canary make cadence-canary ./cadence-canary start # starts both worker and cron scheduler ./cadence-canary start -mode worker # worker only (for manual test execution) ./cadence-canary start -mode cron # cron scheduler only ``` -------------------------------- ### Signal With Start Workflow Source: https://context7.com/cadence-workflow/cadence/llms.txt Atomically starts a workflow if it's not running and then sends a signal to it. ```APIDOC ## `cadence workflow signal-with-start` — Signal with Start Workflow Atomically starts a workflow if it's not running and then sends a signal to it. ### Usage ```bash cadence workflow signal-with-start \ --domain \ --tasklist \ --workflow_type \ --execution_timeout \ --workflow_id \ --name \ --signal_input '' ``` ### Parameters - `--domain` (string, required): The name of the domain. - `--tasklist` (string, required): The task list for the workflow. - `--workflow_type` (string, required): The type of the workflow to start. - `--execution_timeout` (integer, required): The maximum duration for workflow execution in seconds. - `--workflow_id` (string, required): The ID for the workflow execution. - `--name` (string, required): The name of the signal to send. - `--signal_input` (string, optional): A JSON string representing the signal payload. ``` -------------------------------- ### ESQL Pagination with FROM and Search After Source: https://github.com/cadence-workflow/cadence/blob/master/common/elasticsearch/esql/README.md Demonstrates two pagination methods in ESQL: using the FROM keyword for simpler offset-based pagination (with a 10k limit) and using search_after for more advanced cursor-based pagination. ```go // first page sql_page1 := "SELECT * FROM myTable ORDER BY colA, colB LIMIT 10" e := NewESql() dsl_page1, sortFields, err := e.ConvertPretty(sql_page1) ``` ```go // second page // 1. Use FROM to retrieve the 2nd page sql_page2_FROM := "SELECT * FROM myTable ORDER BY colA, colB LIMIT 10 FROM 10" dsl_page2_FROM, sortFields, err := e.ConvertPretty(sql_page2_FROM) ``` ```go // 2. Use search_after to retrieve the 2nd page // we can use sortFields and the query result from page 1 to get the page tokens sql_page2_search_after := sql_page1 page_token_colA := "123" page_token_colB := "bbc" dsl_page2_search_after, sortFields, err := e.ConvertPretty(sql_page2_search_after, page_colA, page_colB) ``` -------------------------------- ### Download Go Dependencies Source: https://github.com/cadence-workflow/cadence/blob/master/CONTRIBUTING.md Download all the necessary Go module dependencies for the project. ```bash go mod download ``` -------------------------------- ### Install Cadence Schema for PostgreSQL Source: https://github.com/cadence-workflow/cadence/blob/master/docs/persistence.md Installs the necessary database schema for Cadence when using PostgreSQL. ```bash cd $GOPATH/github.com/cadence-workflow/cadence make install-schema-postgres ``` -------------------------------- ### Install Cadence Schema for MySQL Source: https://github.com/cadence-workflow/cadence/blob/master/docs/persistence.md Installs the necessary database schema for Cadence when using MySQL. ```bash cd $GOPATH/github.com/cadence-workflow/cadence make install-schema-mysql ``` -------------------------------- ### Setup MySQL Schema for Cadence Source: https://context7.com/cadence-workflow/cadence/llms.txt Sets up the initial MySQL schema for Cadence. Requires connection details, database name, and schema version. ```bash cadence-sql-tool --ep 127.0.0.1 --port 3306 --user uber --pw uber \ --db cadence setup-schema -v 0.0 ``` -------------------------------- ### Build Cadence Auto-Setup Image Source: https://github.com/cadence-workflow/cadence/blob/master/docker/README.md Build a Cadence Docker image with the 'auto-setup' target, which automatically configures database and Elasticsearch schemas on startup. Use this for development environments where automatic setup is desired. ```bash cd $GOPATH/src/github.com/uber/cadence git checkout YOUR_CHECKOUT_BRANCH docker build . -t ubercadence/server:YOUR_TAG-auto-setup --build-arg TARGET=auto-setup ``` -------------------------------- ### Build and Development Commands Source: https://github.com/cadence-workflow/cadence/blob/master/CLAUDE.md Common make targets for building binaries, running tests, linting, and generating code. Use scoped codegen for faster iteration. ```bash make bins # build all binaries make build # compile-check all packages + test files (no codegen, no test execution) make pr # pre-PR: tidy → go-generate → fmt → lint make pr GEN_DIR=service/history # scoped codegen (faster for single package) make test # all unit tests (excludes host/ integration tests) make test_e2e # end-to-end integration tests in host/ (requires Docker dependencies running) make lint # lint only make go-generate # regenerate mocks, enums, wrapper files ``` ```bash go test -race -run TestFoo ./path/to/pkg/... ``` -------------------------------- ### Start Reset Workflow Test Source: https://github.com/cadence-workflow/cadence/blob/master/canary/README.md Manually start a run of the Reset workflow test case to test the reset feature. ```bash cadence --do <> workflow start --tl canary-task-queue --et 10 --wt workflow.reset -i 0 ``` -------------------------------- ### Start Cancellation Workflow Test Source: https://github.com/cadence-workflow/cadence/blob/master/canary/README.md Manually start a run of the Cancellation workflow test case to test the cancellation feature. ```bash cadence --do <> workflow start --tl canary-task-queue --et 10 --wt workflow.cancellation -i 0 ``` -------------------------------- ### Build Cadence Canary Binary Source: https://github.com/cadence-workflow/cadence/blob/master/canary/README.md Build the Cadence canary executable binary from the project root directory. ```bash make cadence-canary ``` -------------------------------- ### Pagination with FROM keyword Source: https://github.com/cadence-workflow/cadence/blob/master/common/elasticsearch/esql/README.md Shows how to use the `FROM` keyword for pagination, similar to standard SQL syntax. Note the limitation of 10k records for this method. ```APIDOC ## Pagination with FROM keyword Use the `FROM` keyword for pagination, analogous to SQL. ### Method `ConvertPretty` ### Parameters - `sql` (string): The SQL query string including `LIMIT` and `FROM` clauses. ### Request Example ```go sql_page2_FROM := "SELECT * FROM myTable ORDER BY colA, colB LIMIT 10 FROM 10" e := NewESql() dsl_page2_FROM, sortFields, err := e.ConvertPretty(sql_page2_FROM) if err == nil { fmt.Println(dsl_page2_FROM) } ``` ### Response - `dsl` (string): The converted Elasticsearch DSL for the specified page. - `sortFields` (array): Fields used for sorting. - `error`: An error object if the conversion fails. ``` -------------------------------- ### Start Signal Workflow Test Source: https://github.com/cadence-workflow/cadence/blob/master/canary/README.md Manually start a run of the Signal workflow test case to test the signal feature. ```bash cadence --do <> workflow start --tl canary-task-queue --et 10 --wt workflow.signal -i 0 ``` -------------------------------- ### Start Cadence Development Server for Clusters Source: https://github.com/cadence-workflow/cadence/blob/master/service/worker/README.md Initiates a Cadence development server for a specific cluster zone. Repeat for each cluster. ```bash ./cadence-server --zone xdc_cluster0 start ``` ```bash ./cadence-server --zone xdc_cluster1 start ``` ```bash ./cadence-server --zone xdc_cluster2 start ``` -------------------------------- ### Conventional Commits Example Source: https://github.com/cadence-workflow/cadence/blob/master/CLAUDE.md Example of a Pull Request title following the Conventional Commits format, specifying type and scope. ```bash feat(history): add retry logic for shard takeover ``` -------------------------------- ### Build Cadence CLI Binary Source: https://github.com/cadence-workflow/cadence/blob/master/README.md Build the Cadence CLI binary locally by checking out the repository and running the make command. Refer to CONTRIBUTING.md for prerequisites. ```bash make cadence ``` -------------------------------- ### Start Retry Workflow Test Source: https://github.com/cadence-workflow/cadence/blob/master/canary/README.md Manually start a run of the Retry workflow test case to test the activity retry policy. ```bash cadence --do <> workflow start --tl canary-task-queue --et 10 --wt workflow.retry -i 0 ``` -------------------------------- ### Start LocalActivity Workflow Test Source: https://github.com/cadence-workflow/cadence/blob/master/canary/README.md Manually start a run of the LocalActivity workflow test case to test the local activity feature. ```bash cadence --do <> workflow start --tl canary-task-queue --et 10 --wt workflow.localactivity -i 0 ``` -------------------------------- ### Run Custom Cadence Server Locally Source: https://github.com/cadence-workflow/cadence/blob/master/docker/README.md This sequence of commands allows you to run a custom-built Cadence server locally alongside its dependencies. First, build your server changes, then start all services, stop the default Cadence server, and finally start your custom server. ```bash docker compose up docker stop docker-cadence-1 ./cadence-server start ``` -------------------------------- ### Start Timeout Workflow Test Source: https://github.com/cadence-workflow/cadence/blob/master/canary/README.md Manually start a run of the Timeout workflow test case to ensure activity timeouts are enforced. ```bash cadence --do <> workflow start --tl canary-task-queue --et 10 --wt workflow.timeout -i 0 ``` -------------------------------- ### Load Balancer Implementation Location Source: https://github.com/cadence-workflow/cadence/blob/master/docs/scalable_tasklist.md The selection algorithms for scalable tasklists are implemented within the client/matching package. ```go client/matching package ``` -------------------------------- ### Start ConcurrentExec Workflow Test Source: https://github.com/cadence-workflow/cadence/blob/master/canary/README.md Manually start a run of the ConcurrentExec workflow test case to test concurrent activity execution. ```bash cadence --do <> workflow start --tl canary-task-queue --et 10 --wt workflow.concurrent-execution -i 0 ```