Skip to content

Function Commands

Commands for viewing function execution logs.

function

Manage functions

Usage

tailor-sdk function [command]

Commands

CommandDescription
function logsList or get function execution logs.
function test-runRun 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

ArgumentDescriptionRequired
executionIdExecution ID (if provided, shows details with logs)No

Options

OptionAliasDescriptionRequiredDefaultEnv
--workspace-id <WORKSPACE_ID>-wWorkspace IDNo-TAILOR_PLATFORM_WORKSPACE_ID
--profile <PROFILE>-pWorkspace profileNo-TAILOR_PLATFORM_PROFILE

See Global Options for options available to all commands.

Usage Examples:

bash
# List all function execution logs
tailor-sdk function logs

# Get execution details with logs
tailor-sdk function logs <execution-id>

# Output as JSON
tailor-sdk function logs --json
tailor-sdk function logs <execution-id> --json

function test-run

Run a function on the Tailor Platform server without deploying.

Usage

tailor-sdk function test-run [options] <file>

Arguments

ArgumentDescriptionRequired
filePath to the function fileYes

Options

OptionAliasDescriptionRequiredDefaultEnv
--workspace-id <WORKSPACE_ID>-wWorkspace IDNo-TAILOR_PLATFORM_WORKSPACE_ID
--profile <PROFILE>-pWorkspace profileNo-TAILOR_PLATFORM_PROFILE
--name <NAME>-nWorkflow job name to run (matches the name field of createWorkflowJob)No--
--arg <ARG>-aJSON argument to pass to the functionNo--
--machine-user <MACHINE_USER>-mMachine user name for authenticationNo--
--config <CONFIG>-cPath to SDK config fileNo"tailor.config.ts"-

Examples

Run a resolver with input arguments

bash
$ tailor-sdk function test-run resolvers/add.ts --arg '{"input":{"a":1,"b":2}}'

Run a specific workflow job by name

bash
$ tailor-sdk function test-run workflows/sample.ts --name validate-order

Run a pre-bundled .js file directly

bash
$ tailor-sdk function test-run build/resolvers/add.js --arg '{"input":{"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.