### Example: Starting a Temporal Development Server Source: https://github.com/temporalio/cli/blob/main/_autodocs/devserver.md Demonstrates how to start a Temporal development server with various configuration options, including frontend, UI, cluster details, logging, database, metrics, and dynamic configuration. ```go server, err := Start(StartOptions{ FrontendIP: "127.0.0.1", FrontendPort: 7233, FrontendHTTPPort: 7243, Namespaces: []string{"default"}, UIIP: "127.0.0.1", UIPort: 8233, ClusterID: "temporal-cluster", MasterClusterName: "temporal", CurrentClusterName: "temporal", InitialFailoverVersion: 1, Logger: slog.Default(), LogLevel: slog.LevelInfo, DatabaseFile: "/tmp/temporal.db", MetricsPort: 9090, EnableGlobalNamespace: false, DynamicConfigValues: map[string]any{ "history.persistenceMaxQueueSize": 1000, }, SearchAttributes: map[string]enums.IndexedValueType{ "CustomAttribute": enums.INDEXED_VALUE_TYPE_KEYWORD, }, }) if err != nil { log.Fatal(err) } def server.Stop() ``` -------------------------------- ### Start Workflow Example Source: https://github.com/temporalio/cli/blob/main/_autodocs/workflow-commands.md Example of starting a workflow execution non-blockingly, providing its ID, type, and task queue. ```bash temporal workflow start \ --workflow-id order-123 \ --type ProcessOrder \ --task-queue default ``` -------------------------------- ### Start Activity Command Example Source: https://github.com/temporalio/cli/blob/main/_autodocs/activity-commands.md Demonstrates how to start a 'ProcessPayment' activity on the 'payments' task queue with a 5-minute schedule-to-close timeout and specific JSON input. Ensure at least one timeout option is provided. ```bash temporal activity start \ --activity-id process-payment-001 \ --type ProcessPayment \ --task-queue payments \ --schedule-to-close-timeout 5m \ --input '{"paymentId":"PAY-123", "amount":99.99}' ``` -------------------------------- ### Start Development Server Source: https://github.com/temporalio/cli/blob/main/_autodocs/server-commands.md Starts a single-node development server with a built-in UI. Use this for local testing and development. ```bash temporal server start-dev [OPTIONS] ``` -------------------------------- ### Start Development Server Source: https://github.com/temporalio/cli/blob/main/_autodocs/00-START-HERE.md Use this command to start a local Temporal development server. The UI will be accessible at the specified address. ```bash temporal server start-dev # UI at http://localhost:8233 ``` -------------------------------- ### Start Dev Server with Multiple Namespaces Source: https://github.com/temporalio/cli/blob/main/_autodocs/server-commands.md Starts the development server and creates multiple namespaces. Each namespace can have independent configurations and executions. ```bash temporal server start-dev \ --namespace production \ --namespace staging \ --namespace development ``` -------------------------------- ### Execute Workflow Example Source: https://github.com/temporalio/cli/blob/main/_autodocs/workflow-commands.md Example of executing a workflow, specifying its ID, type, task queue, and input arguments. ```bash temporal workflow execute \ --workflow-id order-123 \ --type ProcessOrder \ --task-queue default \ --input '{"orderId":"123", "amount":99.99}' ``` -------------------------------- ### Describe Workflow Example Source: https://github.com/temporalio/cli/blob/main/_autodocs/workflow-commands.md Example of how to describe a specific workflow execution using its ID and Run ID. ```bash temporal workflow describe --workflow-id my-workflow-123 --run-id abc-def-ghi ``` -------------------------------- ### Start Function Source: https://github.com/temporalio/cli/blob/main/_autodocs/devserver.md Starts a Temporal development server with the provided configuration options. It returns a running server instance or an error if startup fails. Validation checks are performed on the provided options. ```APIDOC ## Start Function Starts a Temporal development server with the given configuration. ### Method ```go func Start(options StartOptions) (*Server, error) ``` ### Parameters #### Request Body - **options** (`StartOptions`) - Required - Server configuration. See `StartOptions` fields for details. ### Request Example ```go server, err := Start(StartOptions{ FrontendIP: "127.0.0.1", FrontendPort: 7233, FrontendHTTPPort: 7243, Namespaces: []string{"default"}, UIIP: "127.0.0.1", UIPort: 8233, ClusterID: "temporal-cluster", MasterClusterName: "temporal", CurrentClusterName: "temporal", InitialFailoverVersion: 1, Logger: slog.Default(), LogLevel: slog.LevelInfo, DatabaseFile: "/tmp/temporal.db", MetricsPort: 9090, EnableGlobalNamespace: false, DynamicConfigValues: map[string]any{ "history.persistenceMaxQueueSize": 1000, }, SearchAttributes: map[string]enums.IndexedValueType{ "CustomAttribute": enums.INDEXED_VALUE_TYPE_KEYWORD, }, }) if err != nil { log.Fatal(err) } defer server.Stop() ``` ### Response #### Success Response (200) - **Server** (`*Server`) - Running server instance. - **error** (`error`) - Startup error or nil. ### Validation errors: - Missing FrontendIP - Missing FrontendPort - Missing Namespaces - Missing Logger - Missing ClusterID, MasterClusterName, CurrentClusterName, InitialFailoverVersion - UIIP set but UIPort is 0 ``` -------------------------------- ### Get Help Information Source: https://github.com/temporalio/cli/blob/main/_autodocs/README.md Access built-in help for the Temporal CLI and its commands. This provides details on command descriptions, options, usage examples, and default values. ```bash temporal --help ``` ```bash temporal [command] --help ``` -------------------------------- ### Start Function Signature Source: https://github.com/temporalio/cli/blob/main/_autodocs/devserver.md Defines the signature for the Start function, which initiates a Temporal development server. ```go func Start(options StartOptions) (*Server, error) ``` -------------------------------- ### Start Dev Server with Default In-Memory Database Source: https://github.com/temporalio/cli/blob/main/_autodocs/server-commands.md Starts the development server using the default in-memory database. Data will be lost upon server shutdown. ```bash temporal server start-dev ``` -------------------------------- ### Example: Building Client Options and Dialing Source: https://github.com/temporalio/cli/blob/main/_autodocs/client-options.md Demonstrates how to initialize a ClientOptionsBuilder, build client options, and establish a connection to the Temporal service. ```go builder := &ClientOptionsBuilder{ CommonOptions: cctx.RootCommand.CommonOptions, ClientOptions: ClientOptions{ Address: "localhost:7233", Namespace: "default", }, EnvLookup: envconfig.EnvLookupOS, Logger: slog.Default(), } opts, err := builder.Build(ctx) if err != nil { return err } cl, err := client.DialContext(ctx, opts) if err != nil { return err } defer cl.Close() ``` -------------------------------- ### Start Dev Server with Metrics Enabled Source: https://github.com/temporalio/cli/blob/main/_autodocs/server-commands.md Starts a development server and enables Prometheus metrics on a specified port. Access metrics via the /metrics endpoint. ```bash temporal server start-dev \ --metrics-port 9090 ``` -------------------------------- ### JSON Output Example Source: https://github.com/temporalio/cli/blob/main/_autodocs/README.md Shows the structure of JSON output for workflow details. Includes workflow ID, status, and start time. ```json { "workflowId": "wf-123", "status": "RUNNING", "startTime": "2024-01-15T10:30:00Z" } ``` -------------------------------- ### Start Dev Server with Custom Ports Configuration Source: https://github.com/temporalio/cli/blob/main/_autodocs/server-commands.md Starts the development server with custom configurations for frontend, gRPC gateway, UI, and metrics ports. This allows fine-grained control over network exposure. ```bash temporal server start-dev \ --port 7233 \ --http-port 7243 \ --ui-port 8233 \ --metrics-port 9090 ``` -------------------------------- ### Start Temporal Development Server with pprof Source: https://github.com/temporalio/cli/blob/main/_autodocs/server-commands.md Starts a Temporal development server with pprof profiling enabled on a specified port. Access profiling data via the provided URL. ```bash temporal server start-dev --pprof-port 6060 ``` -------------------------------- ### Start Dev Server with SQLite Persistence (Relative Path) Source: https://github.com/temporalio/cli/blob/main/_autodocs/server-commands.md Starts the development server with SQLite persistence using a relative path for the database file. The file will be created in the current working directory. ```bash temporal server start-dev --db-path /tmp/temporal.db ``` -------------------------------- ### Execute Temporal Activity Source: https://github.com/temporalio/cli/blob/main/_autodocs/activity-commands.md Starts an activity and waits for its completion. Combines 'activity start' and 'activity result' functionality. Use when you need to initiate an activity and immediately get its outcome. ```bash temporal activity execute \ --activity-id process-payment-001 \ --type ProcessPayment \ --task-queue payments \ --schedule-to-close-timeout 5m \ --input '{"paymentId":"PAY-123"}' ``` -------------------------------- ### Start Dev Server with Custom Ports Source: https://github.com/temporalio/cli/blob/main/_autodocs/server-commands.md Starts a development server, specifying custom ports for gRPC, HTTP gateway, and UI. Ensure these ports are not in use. ```bash temporal server start-dev \ --ip 127.0.0.1 \ --port 7233 \ --ui-port 8233 ``` -------------------------------- ### Start Dev Server with SQLite Persistence Source: https://github.com/temporalio/cli/blob/main/_autodocs/server-commands.md Starts a development server using SQLite for persistence, storing data in the specified file. This allows data to survive server restarts. ```bash temporal server start-dev \ --db-path /tmp/temporal.db \ --namespace production \ --namespace staging ``` -------------------------------- ### Temporal StartOptions Struct Definition Source: https://github.com/temporalio/cli/blob/main/_autodocs/devserver.md Defines the configuration options for starting the Temporal development server, including required and optional fields. ```go type StartOptions struct { // Required fields FrontendIP string FrontendPort int Namespaces []string ClusterID string MasterClusterName string CurrentClusterName string InitialFailoverVersion int Logger *slog.Logger LogLevel slog.Level // Optional fields UIIP string UIPort int UIAssetPath string UICodecEndpoint string PublicPath string DatabaseFile string MetricsPort int PProfPort int SqlitePragmas map[string]string FrontendHTTPPort int EnableGlobalNamespace bool DynamicConfigValues map[string]any SearchAttributes map[string]enums.IndexedValueType LogConfig func([]byte) GRPCInterceptors []grpc.UnaryServerInterceptor } ``` -------------------------------- ### Batch Query Syntax Examples Source: https://github.com/temporalio/cli/blob/main/_autodocs/batch-operations.md Examples of the SQL-like query language used for filtering workflows in batch operations. ```sql ExecutionStatus = 'RUNNING' WorkflowType = 'ProcessOrder' StartTime > '2024-01-01T00:00:00Z' CloseTime < '2024-01-15T00:00:00Z' ``` -------------------------------- ### Start Dev Server with Debug Logging Source: https://github.com/temporalio/cli/blob/main/_autodocs/server-commands.md Starts the development server with the log level set to debug. This provides detailed output for troubleshooting. ```bash temporal server start-dev --log-level debug ``` -------------------------------- ### Start Workflow with Input from File Source: https://github.com/temporalio/cli/blob/main/_autodocs/payload-handling.md Start a workflow using input data from a JSON file. The CLI reads the file content and uses it as the workflow input payload. ```bash temporal workflow start \ --workflow-id config-123 \ --type ProcessConfig \ --task-queue default \ --input-file config.json ``` -------------------------------- ### Start Local Development Server Source: https://github.com/temporalio/cli/blob/main/_autodocs/README.md Launches an embedded Temporal server for local development with a web UI. Specify IP, port, and UI port. ```bash # Start local server with UI temporal server start-dev \ --ip 127.0.0.1 \ --port 7233 \ --ui-port 8233 # In another terminal, use CLI temporal workflow start \ --workflow-id test-1 \ --type MyWorkflow \ --task-queue default ``` -------------------------------- ### FlagDuration Example Source: https://github.com/temporalio/cli/blob/main/_autodocs/flag-types.md Demonstrates setting a `FlagDuration` from a string with day units and retrieving it as a `time.Duration`. ```go var d FlagDuration d.Set("2d5h") // 2 days and 5 hours dur := d.Duration() // time.Duration ``` -------------------------------- ### FlagTimestamp Example Source: https://github.com/temporalio/cli/blob/main/_autodocs/flag-types.md Demonstrates setting a `FlagTimestamp` from an RFC3339 formatted string. ```go var ts FlagTimestamp ts.Set("2024-01-15T10:30:00Z") ``` -------------------------------- ### Setup New Production Namespace with Custom Attributes Source: https://github.com/temporalio/cli/blob/main/_autodocs/operator-commands.md Demonstrates the process of setting up a new production namespace, including defining its description, retention policies, and adding custom search attributes. This involves multiple commands for creation and verification. ```bash # Create namespace temporal operator namespace create \ --namespace production-2024 \ --description "Q1 2024 production" \ --retention "90d" # Add custom attributes temporal operator search-attribute create \ --namespace production-2024 \ --name "department" \ --type KEYWORD temporal operator search-attribute create \ --namespace production-2024 \ --name "cost" \ --type DOUBLE # Verify setup temporal operator namespace describe --namespace production-2024 temporal operator search-attribute list --namespace production-2024 ``` -------------------------------- ### FlagStringEnum Example Source: https://github.com/temporalio/cli/blob/main/_autodocs/flag-types.md Illustrates creating and setting a `FlagStringEnum`, showing valid and invalid value assignments. ```go enum := NewFlagStringEnum([]string{"text", "json", "none"}, "text") enum.Set("json") // Valid enum.Set("xml") // Error: "xml is not one of required values..." ``` -------------------------------- ### List Workflows Started Today Source: https://github.com/temporalio/cli/blob/main/_autodocs/query-syntax.md Retrieve workflows that started on the current day. Requires specifying the start time in RFC3339 format. ```bash temporal workflow list --query "StartTime > '2024-01-15T00:00:00Z'" ``` -------------------------------- ### Shared Workflow Start Options Structure Source: https://github.com/temporalio/cli/blob/main/_autodocs/workflow-commands.md Defines common options for starting workflows, including identification, task queue, timeouts, and metadata. ```go type SharedWorkflowStartOptions struct { WorkflowId string Type string TaskQueue string RunTimeout cliext.FlagDuration ExecutionTimeout cliext.FlagDuration TaskTimeout cliext.FlagDuration SearchAttribute []string Headers []string Memo []string StaticSummary string StaticDetails string PriorityKey int FairnessKey string FairnessWeight float32 FlagSet *pflag.FlagSet } ``` -------------------------------- ### Start Temporal Development Server with Debug Logging Source: https://github.com/temporalio/cli/blob/main/_autodocs/server-commands.md Starts a Temporal development server and overrides the log level using an environment variable. This is useful for increased verbosity during development. ```bash TEMPORAL_LOG_LEVEL=debug temporal server start-dev ``` -------------------------------- ### Workflow Start Options Structure Source: https://github.com/temporalio/cli/blob/main/_autodocs/workflow-commands.md Defines additional options specific to starting a workflow, such as cron schedules and ID reuse policies. ```go type WorkflowStartOptions struct { Cron string FailExisting bool StartDelay cliext.FlagDuration IdReusePolicy cliext.FlagStringEnum IdConflictPolicy cliext.FlagStringEnum FlagSet *pflag.FlagSet } ``` -------------------------------- ### Get Current Version Source: https://github.com/temporalio/cli/blob/main/_autodocs/README.md Use the 'temporal version' command to retrieve the current CLI version. This is useful for verifying your installation and compatibility. ```bash temporal version ``` -------------------------------- ### File Input Specification Source: https://github.com/temporalio/cli/blob/main/_autodocs/payload-handling.md Examples of how to provide input using files with the --input-file flag, supporting single or multiple files. ```bash # Single file --input-file /path/to/input.json # Multiple files --input-file order.json --input-file payment.json ``` -------------------------------- ### Start Dev Server with Metrics Endpoint Source: https://github.com/temporalio/cli/blob/main/_autodocs/server-commands.md Starts the development server with Prometheus metrics enabled on port 9090. The metrics endpoint is accessible at http://localhost:9090/metrics. ```bash temporal server start-dev --metrics-port 9090 ``` -------------------------------- ### Payload Metadata Example Source: https://github.com/temporalio/cli/blob/main/_autodocs/payload-handling.md An example of JSON payload metadata, including encoding and custom key-value pairs. ```json { "encoding": "json/plain", "key": "value" } ``` -------------------------------- ### List Available Temporal Server Configurations Source: https://github.com/temporalio/cli/blob/main/_autodocs/server-commands.md Lists all available server configurations for the Temporal CLI. This command helps in understanding the different server setups that can be managed. ```bash temporal server list ``` -------------------------------- ### Start Workflow with Simple JSON Input Source: https://github.com/temporalio/cli/blob/main/_autodocs/payload-handling.md Start a workflow with a single JSON payload. The CLI will automatically encode this JSON and represent it in the payload structure. ```bash temporal workflow start \ --workflow-id order-123 \ --type ProcessOrder \ --task-queue default \ --input '{"orderId":"123", "amount":99.99}' ``` -------------------------------- ### JSONL Output Example Source: https://github.com/temporalio/cli/blob/main/_autodocs/README.md Illustrates JSON Lines format for output, with each line representing a distinct workflow object. ```json {"workflowId": "wf-1", "status": "RUNNING"} {"workflowId": "wf-2", "status": "COMPLETED"} ``` -------------------------------- ### SQL-like Query Syntax Example Source: https://github.com/temporalio/cli/blob/main/_autodocs/README.md Demonstrates filtering workflows using SQL-like expressions. Supports status, type, time, and custom fields. ```sql ExecutionStatus = 'RUNNING' WorkflowType = 'ProcessOrder' StartTime > '2024-01-01T00:00:00Z' environment = 'production' customerId IN ('123', '456') department LIKE 'sales%' ``` -------------------------------- ### Start Workflow with Custom Encoding Source: https://github.com/temporalio/cli/blob/main/_autodocs/payload-handling.md Start a workflow with input data that uses a custom encoding. Specify the custom encoding type using the --input-meta flag. ```bash temporal workflow start \ --workflow-id custom-123 \ --type ProcessCustom \ --task-queue default \ --input 'custom-encoded-value' \ --input-meta 'encoding=application/x-custom' ``` -------------------------------- ### Build Temporal CLI from Source Source: https://github.com/temporalio/cli/blob/main/README.md Compile the Temporal CLI executable from its source code. This requires Go to be installed and the repository to be cloned. ```bash go build ./cmd/temporal ``` -------------------------------- ### Run Docker Compose Source: https://github.com/temporalio/cli/blob/main/_autodocs/server-commands.md Command to start the services defined in a Docker Compose file. This will launch the Temporal development server as configured. ```bash docker-compose up ``` -------------------------------- ### Start Temporal Dev Server with Docker Source: https://github.com/temporalio/cli/blob/main/README.md Launch the Temporal development server using Docker, exposing necessary ports and binding to all network interfaces. This allows the dev server to be accessible from the host system. ```bash docker run --rm -p 7233:7233 -p 8233:8233 temporalio/temporal:latest server start-dev --ip 0.0.0.0 ``` -------------------------------- ### Listing Running Workflows with Query Source: https://github.com/temporalio/cli/blob/main/_autodocs/query-syntax.md Example of using the `temporal workflow list` command with a query to find currently running workflows. ```bash temporal workflow list --query "ExecutionStatus = 'RUNNING'" ``` -------------------------------- ### Start a Workflow Source: https://github.com/temporalio/cli/blob/main/_autodocs/00-START-HERE.md Initiates a new workflow execution. Specify the workflow ID, type, task queue, and any necessary input data. ```bash temporal workflow start \ --workflow-id my-workflow \ --type MyWorkflow \ --task-queue default \ --input '{"key": "value"}' ``` -------------------------------- ### ActivityStartOptions Struct Source: https://github.com/temporalio/cli/blob/main/_autodocs/activity-commands.md Defines the configuration structure for starting an activity execution via the CLI. It includes fields for activity identification, task queue, various timeouts, retry policies, and metadata. ```go type ActivityStartOptions struct { ActivityId string Type string TaskQueue string ScheduleToCloseTimeout cliext.FlagDuration ScheduleToStartTimeout cliext.FlagDuration StartToCloseTimeout cliext.FlagDuration HeartbeatTimeout cliext.FlagDuration RetryInitialInterval cliext.FlagDuration RetryMaximumInterval cliext.FlagDuration RetryBackoffCoefficient float32 RetryMaximumAttempts int IdReusePolicy cliext.FlagStringEnum IdConflictPolicy cliext.FlagStringEnum SearchAttribute []string Headers []string StaticSummary string StaticDetails string PriorityKey int FairnessKey string FairnessWeight float32 FlagSet *pflag.FlagSet } ``` -------------------------------- ### Metadata Override Examples Source: https://github.com/temporalio/cli/blob/main/_autodocs/payload-handling.md Demonstrates how to override payload encoding and provide custom metadata using the --input-meta flag. ```bash # Default: JSON encoding --input '{"data":"value"}' # Override encoding --input '{"data":"value"}' --input-meta 'encoding=json/plain' # Custom metadata --input 'rawdata' --input-meta 'encoding=custom/type' --input-meta 'key=value' ``` -------------------------------- ### Base64 Encoding for Binary Data Source: https://github.com/temporalio/cli/blob/main/_autodocs/payload-handling.md Example of using --input-file and --input-base64 to read a binary file, base64-encode it, and pass it as a binary payload to the CLI. ```bash temporal workflow start \ --workflow-id process-binary \ --type ProcessBinary \ --task-queue default \ --input-file binary-data.bin \ --input-base64 ``` -------------------------------- ### Custom Encoding Example Source: https://github.com/temporalio/cli/blob/main/_autodocs/payload-handling.md Shows how to specify a custom encoding for a payload using the --input-meta flag. ```bash --input '{"custom":"data"}' --input-meta 'encoding=application/custom' ``` -------------------------------- ### Listing Failed Workflows Source: https://github.com/temporalio/cli/blob/main/_autodocs/query-syntax.md Example of using the `temporal workflow list` command with a query to find workflows that have failed. ```bash temporal workflow list --query "ExecutionStatus = 'FAILED'" ``` -------------------------------- ### Run Temporal CLI Help via Docker Source: https://github.com/temporalio/cli/blob/main/README.md Execute the Temporal CLI with the --help flag using Docker. This is useful for quickly checking available commands and options without a local installation. ```bash docker run --rm temporalio/temporal --help ``` -------------------------------- ### Passing Pre-encoded Payload as RawValue Source: https://github.com/temporalio/cli/blob/main/_autodocs/payload-handling.md Example of how to construct a common.Payload and pass it as a RawValue to avoid re-encoding. ```go // Internal code payload := &common.Payload{ Data: protoBytes, Metadata: map[string][]byte{ "encoding": []byte("json/protobuf"), }, } // Pass as RawValue to avoid re-encoding input := temporalcli.RawValue{Payload: payload} ``` -------------------------------- ### JSON Input Specification Source: https://github.com/temporalio/cli/blob/main/_autodocs/payload-handling.md Examples of how to provide JSON input values as single or multiple arguments using the --input flag. ```bash # Single argument --input '{"orderId":"123", "amount":99.99}' # Multiple arguments --input '{"orderId":"123"}' --input '{"amount":99.99}' ``` -------------------------------- ### Retry Policy Example Source: https://github.com/temporalio/cli/blob/main/_autodocs/activity-commands.md Illustrates a retry policy configuration with initial delay, maximum duration, coefficient, and number of attempts. ```plaintext Initial: 1s Max: 10s Coefficient: 2.0 Attempts: 5 ``` -------------------------------- ### Payload Shorthand Example Source: https://github.com/temporalio/cli/blob/main/_autodocs/printer.md Illustrates the abbreviated form for complex payloads in JSON output when payload shorthand is enabled. ```json { "input": "$PayloadShorthand(encoding='json/plain', size=1234)" } ``` -------------------------------- ### Start List Mode for Structured Outputs Source: https://github.com/temporalio/cli/blob/main/_autodocs/printer.md Begins list mode for printing multiple structured outputs. Must be paired with `EndList`. In formatted JSON mode, it outputs an opening bracket `[`. ```go printer.StartList() for _, item := range items { printer.PrintStructured(item, options) } printer.EndList() ``` -------------------------------- ### Get Current Temporal Server Configuration Source: https://github.com/temporalio/cli/blob/main/_autodocs/server-commands.md Displays the current configuration of the Temporal server. This is useful for verifying the active settings and parameters. ```bash temporal server get ``` -------------------------------- ### FlagStringEnumArray Example Source: https://github.com/temporalio/cli/blob/main/_autodocs/flag-types.md Demonstrates appending a value to `FlagStringEnumArray` using case-insensitive input and showing the preserved case in the output. ```go enum := NewFlagStringEnumArray([]string{"SearchAttribute", "Memo"}, []string{}) enum.Set("searchattribute") // Appends "SearchAttribute" enum.String() // "SearchAttribute" ``` -------------------------------- ### Set Table Header Color Source: https://github.com/temporalio/cli/blob/main/_autodocs/printer.md Example of setting a custom color for table headers using the color package. This demonstrates how to assign a Colorer function. ```go import "github.com/fatih/color" printer.TableHeaderColorer = color.New(color.FgCyan).SprintfFunc() ``` -------------------------------- ### Filtering Workflows by Time Attributes Source: https://github.com/temporalio/cli/blob/main/_autodocs/query-syntax.md Demonstrates filtering workflows based on their start, close, and update times using various comparison operators. ```sql StartTime > '2024-01-01T00:00:00Z' StartTime >= '2024-01-01T00:00:00Z' StartTime < '2024-01-15T23:59:59Z' CloseTime > '2024-01-01T00:00:00Z' UpdateTime > '2024-01-01T00:00:00Z' ``` -------------------------------- ### Set Custom Logger Source: https://github.com/temporalio/cli/blob/main/_autodocs/devserver.md Provide a custom logger instance to the Temporal server. This example uses the standard Go `slog` package to create a text-based logger outputting to stderr. ```go options.Logger = slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{ Level: slog.LevelInfo, })) ``` -------------------------------- ### Connect to Temporal Server using Go SDK Source: https://github.com/temporalio/cli/blob/main/_autodocs/server-commands.md Demonstrates how to establish a client connection to a Temporal server from a Go application using the Temporal Go SDK. Ensure the server is running and accessible at the specified HostPort. ```go import "go.temporal.io/sdk/client" cl, err := client.Dial(client.Options{ HostPort: "localhost:7233", }) if err != nil { log.Fatal(err) } defer cl.Close() ``` -------------------------------- ### Query Optimization with Indexed Attributes Source: https://github.com/temporalio/cli/blob/main/_autodocs/query-syntax.md Shows an example of an efficient query that leverages indexed attributes like ExecutionStatus and WorkflowType, combined with a custom indexed attribute. This leads to faster query performance. ```sql -- GOOD: Uses indices first, then filters ExecutionStatus = 'RUNNING' AND WorkflowType = 'ProcessOrder' AND customAttr = 'value' ``` -------------------------------- ### Listing Workflows by Type using IN and LIKE Source: https://github.com/temporalio/cli/blob/main/_autodocs/query-syntax.md Demonstrates listing workflows by a specific type, multiple types using IN, and pattern matching using LIKE. ```bash temporal workflow list --query "WorkflowType = 'ProcessOrder'" # Multiple types temporal workflow list --query "WorkflowType IN ('ProcessOrder', 'ProcessPayment')" # Pattern match temporal workflow list --query "WorkflowType LIKE 'Process%'" ``` -------------------------------- ### File Organization in Repository Source: https://github.com/temporalio/cli/blob/main/_autodocs/00-START-HERE.md Illustrates the directory structure of the Temporal CLI repository, showing the placement of binary entry points, client extensions, internal logic, and other modules. ```go cli/ \ ├── cmd/temporal/main.go # Binary entry point ├── cliext/ │ ├── client.go # ClientOptionsBuilder │ ├── flags.types.go # Custom flag types │ └── flags.gen.go # Generated flags ├── internal/ │ ├── temporalcli/ │ │ ├── commands.go # Main CLI logic │ │ ├── client.go # Client creation │ │ ├── commands.workflow.go # Workflow commands │ │ ├── commands.activity.go # Activity commands │ │ ├── commands.schedule.go # Schedule commands │ │ └── ... (more commands) │ ├── printer/printer.go # Output formatting │ ├── devserver/server.go # Dev server │ └── tracer/ # Workflow tracing └── README.md ``` -------------------------------- ### Invalid Syntax Error Example Source: https://github.com/temporalio/cli/blob/main/_autodocs/query-syntax.md An example of an error message indicating invalid query syntax. Common causes include mismatched quotes, missing operators, or incorrect attribute names. ```text Error: invalid query expression: unexpected token 'INVALID' Check for: - Mismatched quotes - Missing operators - Invalid attribute names ``` -------------------------------- ### Build with Build-Time Info and Spaces Source: https://github.com/temporalio/cli/blob/main/CONTRIBUTING.md Build the Temporal CLI binary, injecting build-time information that includes spaces. Note the use of single quotes to handle spaces within the ldflags value. ```bash go build -ldflags "-X 'github.com/temporalio/cli/internal.buildInfo=ServerBranch $(git -C ../temporal rev-parse --abbrev-ref HEAD)'" -o temporal ./cmd/temporal/main.go ``` -------------------------------- ### Run All Tests Source: https://github.com/temporalio/cli/blob/main/CONTRIBUTING.md Execute all tests within the project using the standard Go testing command. This is the primary way to run tests. ```bash go test ./... ``` -------------------------------- ### Get Workflow Result Source: https://github.com/temporalio/cli/blob/main/_autodocs/workflow-commands.md Retrieves the result of a completed workflow execution. Requires the workflow ID. ```bash temporal workflow result --workflow-id order-123 ``` -------------------------------- ### Filtering Workflows by Execution Status Source: https://github.com/temporalio/cli/blob/main/_autodocs/query-syntax.md Provides examples of filtering workflows based on their current execution status. ```sql ExecutionStatus = 'RUNNING' ExecutionStatus = 'COMPLETED' ExecutionStatus = 'FAILED' ExecutionStatus = 'CANCELED' ExecutionStatus = 'TERMINATED' ExecutionStatus = 'CONTINUED_AS_NEW' ExecutionStatus = 'TIMED_OUT' ``` -------------------------------- ### Configure Client with TLS and Namespace Source: https://github.com/temporalio/cli/blob/main/_autodocs/00-START-HERE.md Connects to a Temporal cluster using specific address, namespace, and TLS configuration. Requires certificate paths for secure connections. ```bash temporal workflow list \ --address temporal.company.com:7233 \ --namespace production \ --tls \ --tls-cert-path /path/to/cert.pem ``` -------------------------------- ### Show Workflow Raw Protobuf Source: https://github.com/temporalio/cli/blob/main/_autodocs/payload-handling.md Use the 'show' command to inspect the raw protobuf structure of a workflow execution, including all metadata. ```bash temporal workflow show --workflow-id my-workflow ``` -------------------------------- ### Filtering Workflows by Identification Fields Source: https://github.com/temporalio/cli/blob/main/_autodocs/query-syntax.md Examples for filtering workflows using their unique IDs, types, and pattern matching. ```sql WorkflowId = 'my-workflow-123' WorkflowId LIKE 'order-%' WorkflowId LIKE '%staging' WorkflowType = 'ProcessOrder' RunId = 'abc-def-ghi' ``` -------------------------------- ### Basic Comparisons in Workflow Queries Source: https://github.com/temporalio/cli/blob/main/_autodocs/query-syntax.md Demonstrates basic comparison operators for filtering workflows by status, type, and time. ```sql ExecutionStatus = 'RUNNING' WorkflowType = 'ProcessOrder' StartTime > '2024-01-01T00:00:00Z' CloseTime < '2024-01-31T23:59:59Z' ``` -------------------------------- ### Terminate Old Running Workflows Source: https://github.com/temporalio/cli/blob/main/_autodocs/query-syntax.md Terminate workflows that are running and started before a specific date. This is useful for cleaning up old or abandoned executions. ```bash temporal workflow terminate --query "ExecutionStatus = 'RUNNING' AND StartTime < '2023-12-01T00:00:00Z'" --reason "Timeout - older than 30 days" ``` -------------------------------- ### Set Database File Path Source: https://github.com/temporalio/cli/blob/main/_autodocs/devserver.md Configure the server to use a persistent SQLite database file. Set the DatabaseFile option to the desired path. ```go options.DatabaseFile = "/tmp/temporal.db" ``` -------------------------------- ### Build Temporal CLI Binaries with Goreleaser Source: https://github.com/temporalio/cli/blob/main/CONTRIBUTING.md Use Goreleaser to build the project's binaries. This is a prerequisite for building the Docker image. ```bash goreleaser build --snapshot --clean ``` -------------------------------- ### Cancel Workflows of a Deprecated Type Source: https://github.com/temporalio/cli/blob/main/_autodocs/query-syntax.md This example shows how to cancel all running workflows of a specific deprecated type. It filters by both WorkflowType and ExecutionStatus. ```bash temporal workflow cancel \ --query "WorkflowType = 'LegacyProcess' AND ExecutionStatus = 'RUNNING'" \ --reason "Service deprecation" ``` -------------------------------- ### Temporal CLI Help Commands Source: https://github.com/temporalio/cli/blob/main/_autodocs/INDEX.md Access help information for the Temporal CLI. Use global help or command-specific help. ```bash temporal --help ``` ```bash temporal [command] --help ``` ```bash temporal version ``` -------------------------------- ### Create Command Context Source: https://github.com/temporalio/cli/blob/main/_autodocs/main-functions.md Initializes a CommandContext for CLI command execution, setting up essential subsystems like IO streams, arguments, signal handling, and logging. ```go cctx, cancel, err := NewCommandContext(context.Background(), CommandOptions{ Args: []string{"workflow", "list", "--namespace", "default"}, }) if err != nil { return err } deferrcancel() ``` -------------------------------- ### Execute Activity with Base64 Binary Input Source: https://github.com/temporalio/cli/blob/main/_autodocs/payload-handling.md Execute an activity with binary data provided via a file, using the --input-base64 flag. This is useful for non-textual data. ```bash # Create binary file echo "binary data" | base64 > data.b64 temporal activity execute \ --activity-id binary-001 \ --type ProcessBinary \ --task-queue default \ --input-file data.b64 \ --input-base64 ``` -------------------------------- ### Build Method Signature for ClientOptionsBuilder Source: https://github.com/temporalio/cli/blob/main/_autodocs/client-options.md Signature for the Build method, which creates SDK client.Options from builder configuration. ```go func (b *ClientOptionsBuilder) Build(ctx context.Context) (client.Options, error) ``` -------------------------------- ### Generate Documentation Locally Source: https://github.com/temporalio/cli/blob/main/CONTRIBUTING.md Generate new documentation files locally from command definitions and option sets. The output is placed in the dist/docs directory. ```bash go run ./cmd/gen-docs -input internal/temporalcli/commands.yaml -input cliext/option-sets.yaml -output dist/docs ``` -------------------------------- ### Set Active Cluster for a Namespace Source: https://github.com/temporalio/cli/blob/main/_autodocs/operator-commands.md Designates the active cluster for a given namespace in a multi-cluster setup. This ensures that requests are directed to the correct cluster. ```bash temporal operator namespace update \ --namespace global-ns \ --active-cluster cluster-1 ``` -------------------------------- ### List Long-Running Workflows Source: https://github.com/temporalio/cli/blob/main/_autodocs/query-syntax.md Identify workflows that are still running and started more than 7 days ago. This helps in finding potentially stuck or long-running executions. ```bash temporal workflow list --query "StartTime < '2024-01-08T00:00:00Z' AND ExecutionStatus = 'RUNNING'" ``` -------------------------------- ### Inject Build-Time Information Source: https://github.com/temporalio/cli/blob/main/CONTRIBUTING.md Build the Temporal CLI binary and inject custom build-time information into the version string. This is useful for tracking specific builds or local modifications. ```bash go build -ldflags "-X github.com/temporalio/cli/internal.buildInfo=" ``` -------------------------------- ### Describe a Namespace Source: https://github.com/temporalio/cli/blob/main/_autodocs/operator-commands.md View the configuration details of a specific namespace, including its metadata, retention periods, and cluster configuration. Specify the namespace name using the --namespace flag. ```bash temporal operator namespace describe --namespace production ``` -------------------------------- ### Filtering Workflows by Numeric and Boolean Fields Source: https://github.com/temporalio/cli/blob/main/_autodocs/query-syntax.md Examples for filtering using numeric fields like Memo and SearchAttributes, and boolean fields like IsCron. ```sql Memo.fieldName = 123 SearchAttributes.age >= 18 SearchAttributes.score > 100 IsCron = true IsCron = false CanBeTerminatedExternally = true ``` -------------------------------- ### Get Cluster Search Attributes Source: https://github.com/temporalio/cli/blob/main/_autodocs/operator-commands.md Retrieves all search attributes configured across the Temporal cluster. This command is useful for understanding the available metadata for workflows. ```bash temporal operator cluster get-search-attributes ``` -------------------------------- ### Describe Task Queue Configuration Source: https://github.com/temporalio/cli/blob/main/_autodocs/operator-commands.md Shows the configuration details for a specific task queue within a given namespace. Ensure you have the correct namespace and task queue name. ```bash temporal operator task-queue describe \ --namespace production \ --task-queue order-processing ``` -------------------------------- ### Reset Failed Workflows of a Specific Type Source: https://github.com/temporalio/cli/blob/main/_autodocs/query-syntax.md This example demonstrates how to reset failed workflows of a particular type. It filters by WorkflowType and ExecutionStatus, and specifies the reset type. ```bash temporal workflow reset \ --query "WorkflowType = 'ProcessOrder' AND ExecutionStatus = 'FAILED'" \ --reset-type "FirstDecisionScheduled" \ --reason "Automatic recovery" ``` -------------------------------- ### Dial Temporal Client Source: https://github.com/temporalio/cli/blob/main/_autodocs/main-functions.md Establishes a connection to the Temporal service with CLI-specific customizations, including identity, data converters, and interceptors. ```go cl, err := dialClient(cctx, &cliext.ClientOptions{ Address: "localhost:7233", Namespace: "default", }) if err != nil { return err } deferrcl.Close() ``` -------------------------------- ### Logical Operator Precedence Example Source: https://github.com/temporalio/cli/blob/main/_autodocs/query-syntax.md Illustrates operator precedence in Temporal CLI queries, showing how AND and OR are evaluated. Parentheses can be used to explicitly define the order of operations. ```sql -- Parsed as: (a OR b) AND c a OR b AND c -- Different meaning: a OR (b AND c) a OR (b AND c) -- Use parentheses for clarity (ExecutionStatus = 'RUNNING' OR ExecutionStatus = 'COMPLETED') AND WorkflowType = 'ProcessOrder' ``` -------------------------------- ### RFC3339 Timestamp Formats Source: https://github.com/temporalio/cli/blob/main/_autodocs/query-syntax.md Provides examples of valid RFC3339 timestamp formats accepted by the Temporal CLI, including UTC, with timezone offsets, and with fractional seconds. ```text 2024-01-15T10:30:00Z # UTC 2024-01-15T10:30:00-05:00 # EST 2024-01-15T10:30:00.123Z # With milliseconds 2024-01-15T10:30:00.123456Z # With microseconds ``` -------------------------------- ### ClientOptionsBuilder.Build Source: https://github.com/temporalio/cli/blob/main/_autodocs/client-options.md Builds SDK client options from the builder configuration. It handles loading profiles, applying environment variables and flags, and configuring TLS and codec settings. ```APIDOC ## Build Method ### Description Creates SDK client.Options from builder configuration. ### Method `Build` ### Parameters #### Path Parameters - **ctx** (`context.Context`) - Required - Context for profile loading and client creation ### Response #### Success Response - **client.Options** (`client.Options`) - Configured SDK client options - **error** (`error`) - Configuration error ### Behavior 1. Loads client config profile from file or environment 2. Applies legacy TLS environment variables if present 3. Overrides profile settings from flags 4. Replaces `${namespace}` template in address with configured namespace 5. Configures API key if provided 6. Processes gRPC metadata headers 7. Sets up TLS configuration 8. Configures codec settings ### Request Example ```go builder := &ClientOptionsBuilder{ CommonOptions: cctx.RootCommand.CommonOptions, ClientOptions: ClientOptions{ Address: "localhost:7233", Namespace: "default", }, EnvLookup: envconfig.EnvLookupOS, Logger: slog.Default(), } opts, err := builder.Build(ctx) if err != nil { return err } cl, err := client.DialContext(ctx, opts) if err != nil { return err } defer cl.Close() ``` ``` -------------------------------- ### Execute CLI Command Source: https://github.com/temporalio/cli/blob/main/_autodocs/main-functions.md The main entry point for executing the Temporal CLI. It handles command building, execution via Cobra, and signal interruption. ```go package main import ( "context" "github.com/temporalio/cli/internal/temporalcli" ) func main() { ctx := context.Background() err := temporalcli.Execute(ctx, temporalcli.CommandOptions{}) if err != nil { panic(err) } } ``` -------------------------------- ### Count Temporal Activities Source: https://github.com/temporalio/cli/blob/main/_autodocs/activity-commands.md Counts activities matching a specified filter. Use this command to get the number of activities that meet certain criteria, such as status or type. ```bash # All running activities temporal activity count --query "ExecutionStatus = 'RUNNING'" ``` ```bash # By type temporal activity count --query "ActivityType = 'ProcessPayment'" ``` -------------------------------- ### Schedule Configuration Options Structure Source: https://github.com/temporalio/cli/blob/main/_autodocs/schedule-commands.md Defines the configuration options for Temporal Schedules, including timing, catch-up, jitter, and lifecycle management. ```go type ScheduleConfigurationOptions struct { Calendar []string CatchupWindow cliext.FlagDuration Cron []string EndTime cliext.FlagTimestamp Interval []string Jitter cliext.FlagDuration Notes string Paused bool PauseOnFailure bool RemainingActions int StartTime cliext.FlagTimestamp TimeZone string FlagSet *pflag.FlagSet } ``` -------------------------------- ### Get Temporal Activity Result Source: https://github.com/temporalio/cli/blob/main/_autodocs/activity-commands.md Retrieves the result of a completed activity. Use when you have an activity ID and optionally a run ID and want to fetch its final output. ```bash temporal activity result \ --activity-id process-payment-001 \ --run-id abc-def-ghi ``` -------------------------------- ### List Schedules with Query Source: https://github.com/temporalio/cli/blob/main/_autodocs/schedule-commands.md Use this command to list all schedules in a namespace, optionally filtering them using a SQL-like query. The `--limit` option controls the number of results. ```bash # All paused schedules temporal schedule list --query "IsPaused = true" ``` ```bash # By workflow type temporal schedule list --query "WorkflowType = 'GenerateReport'" ``` -------------------------------- ### Test Workflow List Query Source: https://github.com/temporalio/cli/blob/main/_autodocs/query-syntax.md Use this command to test your query by listing up to 10 workflows that match the specified criteria. This helps verify the correctness of your query before performing batch operations. ```bash temporal workflow list --query "YOUR_QUERY" --limit 10 ``` -------------------------------- ### ClientOptions Struct Definition Source: https://github.com/temporalio/cli/blob/main/_autodocs/client-options.md Defines the structure for client configuration, including address, TLS settings, authentication, and codec options. ```go type ClientOptions struct { Address string ClientAuthority string Namespace string ApiKey string GrpcMeta []string Tls bool TlsCertPath string TlsCertData string TlsKeyPath string TlsKeyData string TlsCaPath string TlsCaData string TlsDisableHostVerification bool TlsServerName string CodecEndpoint string CodecAuth string CodecHeader []string Identity string FlagSet *pflag.FlagSet } ``` -------------------------------- ### Execute Activity with Multiple Arguments Source: https://github.com/temporalio/cli/blob/main/_autodocs/payload-handling.md Execute an activity with multiple input arguments, each provided as a separate --input flag. The CLI will create distinct payloads for each argument. ```bash temporal activity execute \ --activity-id pay-001 \ --type ProcessPayment \ --task-queue payments \ --input '{"paymentId":"PAY-123"}' \ --input '99.99' \ --input '{"method":"credit_card"}' ``` -------------------------------- ### Cancel Workflows with Complex Filtering Source: https://github.com/temporalio/cli/blob/main/_autodocs/query-syntax.md This example shows how to perform a batch cancellation of workflows based on multiple criteria, including department, priority, and execution status. It uses OR and AND operators for complex filtering. ```bash temporal workflow cancel \ --query "(department = 'sales' OR department = 'support') AND priority = 'low' AND ExecutionStatus = 'RUNNING'" \ --reason "Off-peak shutdown" ``` -------------------------------- ### Populate Flags from Environment Variables Source: https://github.com/temporalio/cli/blob/main/_autodocs/main-functions.md Populates flag values from environment configuration and variables. Explicitly set flags have the highest priority, followed by environment config files (deprecated), and then environment variables. ```go func (c *CommandContext) populateFlagsFromEnv(flags *pflag.FlagSet) error ``` -------------------------------- ### Log Configuration Callback Source: https://github.com/temporalio/cli/blob/main/_autodocs/devserver.md Set a callback function to inspect the server's YAML configuration. This function is invoked with the configuration as a byte slice. ```go options.LogConfig = func(configYAML []byte) { fmt.Println(string(configYAML)) } ``` -------------------------------- ### Delete Workflows Older Than 90 Days Source: https://github.com/temporalio/cli/blob/main/_autodocs/query-syntax.md This example demonstrates how to delete workflows that were closed more than 90 days ago using a time-based query. It dynamically generates the timestamp for 90 days ago in RFC3339 format. ```bash temporal workflow delete \ --query "CloseTime < '$(date -u -d '90 days ago' +'%Y-%m-%dT%H:%M:%SZ')'" \ --reason "Retention cleanup" ``` -------------------------------- ### NewCommandContext Constructor Source: https://github.com/temporalio/cli/blob/main/_autodocs/command-context.md Creates a new CommandContext for command execution. It requires a base context and command options, and returns the initialized context, a cancel function, and any initialization error. ```go func NewCommandContext(ctx context.Context, options CommandOptions) (*CommandContext, context.CancelFunc, error) ``` ```go ctx, cancel, err := NewCommandContext(context.Background(), CommandOptions{ Args: []string{"workflow", "list"}, }) if err != nil { return err } deferr cancel() ``` -------------------------------- ### New FlagStringEnum Constructor Source: https://github.com/temporalio/cli/blob/main/_autodocs/flag-types.md Creates a new `FlagStringEnum` with a list of allowed values and a default value. ```go func NewFlagStringEnum(allowed []string, value string) FlagStringEnum ``` -------------------------------- ### Creating Custom Search Attributes Source: https://github.com/temporalio/cli/blob/main/_autodocs/query-syntax.md Demonstrates how to create custom search attributes for a namespace using the Temporal CLI operator. ```bash temporal operator search-attribute create \ --namespace production \ --name "department" \ --type KEYWORD temporal operator search-attribute create \ --namespace production \ --name "processingTime" \ --type INT temporal operator search-attribute create \ --namespace production \ --name "isUrgent" \ --type BOOL ``` -------------------------------- ### Build Temporal CLI Source: https://github.com/temporalio/cli/blob/main/_autodocs/INDEX.md Build the Temporal CLI binary from source. This command is used to compile the CLI tool. ```bash go build ./cmd/temporal ``` -------------------------------- ### Describe Workflow with Payloads Source: https://github.com/temporalio/cli/blob/main/_autodocs/payload-handling.md Use the 'describe' command to view workflow details, including input and result payloads, which are decoded and formatted for readability. ```bash temporal workflow describe --workflow-id my-workflow ``` -------------------------------- ### List All Namespaces Source: https://github.com/temporalio/cli/blob/main/_autodocs/operator-commands.md Retrieve a list of all namespaces in the Temporal cluster. You can control the number of results and the page size using the --limit and --page-size flags. ```bash temporal operator namespace list --limit 50 ``` -------------------------------- ### ClientOptionsBuilder Struct Definition Source: https://github.com/temporalio/cli/blob/main/_autodocs/client-options.md Defines the structure for building ClientOptions, including common CLI options, client-specific options, environment lookup, logger, and payload codec. ```go type ClientOptionsBuilder struct { CommonOptions CommonOptions ClientOptions ClientOptions EnvLookup envconfig.EnvLookup Logger *slog.Logger PayloadCodec converter.PayloadCodec } ``` -------------------------------- ### Create a Daily Schedule Source: https://github.com/temporalio/cli/blob/main/_autodocs/schedule-commands.md Use this command to create a new schedule that runs daily at a specific time. Requires schedule ID, workflow type, task queue, cron expression, timezone, and optionally workflow input. ```bash temporal schedule create \ --schedule-id daily-report \ --workflow-type GenerateReport \ --task-queue default \ --cron "0 9 * * *" \ --timezone "America/New_York" \ --input '{"reportType":"daily"}' ``` -------------------------------- ### Create Global Namespace Source: https://github.com/temporalio/cli/blob/main/_autodocs/operator-commands.md Creates a new namespace designated as global, which is a prerequisite for multi-cluster configurations. This command requires the namespace name and the --global flag. ```bash temporal operator namespace create \ --namespace global-ns \ --global ``` -------------------------------- ### Querying with Custom Search Attributes Source: https://github.com/temporalio/cli/blob/main/_autodocs/query-syntax.md Shows how to use custom search attributes like 'department', 'processingTime', and 'isUrgent' in queries. ```sql department = 'sales' processingTime > 3600 isUrgent = true ``` -------------------------------- ### List Workflows with Query Source: https://github.com/temporalio/cli/blob/main/_autodocs/workflow-commands.md Lists workflow executions in a namespace, with options to filter results using a query. Supports filtering by status, type, or custom search attributes. ```bash # All running workflows temporal workflow list --query "ExecutionStatus = 'RUNNING'" # Workflows by type temporal workflow list --query "WorkflowType = 'ProcessOrder'" # By custom search attribute temporal workflow list --query "status = 'pending'" ```