Function Commands
Commands for viewing function execution logs.
function
Manage functions
Usage
tailor-sdk function [command]Commands
| Command | Description |
|---|---|
function logs | List or get function execution logs. |
function test-run | Run a function on the Tailor Platform server without deploying. |
See Global Options for options available to all commands.
function logs
List or get function execution logs.
Usage
tailor-sdk function logs [options] [executionId]Arguments
| Argument | Description | Required |
|---|---|---|
executionId | Execution ID (if provided, shows details with logs) | No |
Options
| Option | Alias | Description | Required | Default | Env |
|---|---|---|---|---|---|
--workspace-id <WORKSPACE_ID> | -w | Workspace ID | No | - | TAILOR_PLATFORM_WORKSPACE_ID |
--profile <PROFILE> | -p | Workspace profile | No | - | TAILOR_PLATFORM_PROFILE |
See Global Options for options available to all commands.
Examples
List all function execution logs
$ tailor-sdk function logsGet execution details with logs
$ tailor-sdk function logs <execution-id>Output as JSON
$ tailor-sdk function logs --jsonGet execution details as JSON
$ tailor-sdk function logs <execution-id> --jsonNotes
When viewing a specific execution that failed, the command displays error details with the stack trace mapped back to original source files via the inline sourcemap (clickable file links and code snippets, matching function test-run output).
When the deployed script cannot be downloaded or the function has been redeployed since the execution, the command falls back to a plain-text error display to avoid showing misleading source locations.
function test-run
Run a function on the Tailor Platform server without deploying.
Usage
tailor-sdk function test-run [options] <file>Arguments
| Argument | Description | Required |
|---|---|---|
file | Path to the function file | Yes |
Options
| Option | Alias | Description | Required | Default | Env |
|---|---|---|---|---|---|
--workspace-id <WORKSPACE_ID> | -w | Workspace ID | No | - | TAILOR_PLATFORM_WORKSPACE_ID |
--profile <PROFILE> | -p | Workspace profile | No | - | TAILOR_PLATFORM_PROFILE |
--name <NAME> | -n | Workflow job name to run (matches the name field of createWorkflowJob) | No | - | - |
--arg <ARG> | -a | JSON argument to pass to the function | No | - | - |
--machine-user <MACHINE_USER> | -m | Machine user name for authentication | No | - | TAILOR_PLATFORM_MACHINE_USER_NAME |
--config <CONFIG> | -c | Path to SDK config file | No | "tailor.config.ts" | - |
Examples
Run a resolver with input arguments
$ tailor-sdk function test-run resolvers/add.ts --arg '{"a":1,"b":2}'Run a specific workflow job by name
$ tailor-sdk function test-run workflows/sample.ts --name validate-orderRun a pre-bundled .js file directly
$ tailor-sdk function test-run build/resolvers/add.js --arg '{"a":1,"b":2}'Notes
You can pass either a source file (.ts) or a pre-bundled file (.js). When a .js file is provided, detection and bundling are skipped and the file is executed as-is.
WARNING
Workflow job .trigger() calls do not work in test-run mode. Triggered jobs are not executed; only the target job's body function runs in isolation.
See Global Options for options available to all commands.