At cli.do, we talk a lot about agentic workflows. The ability to take a complex business process, define it as code, and deploy it with a single command like do workflow deploy is a game-changer for developers. It brings unprecedented speed and consistency to building and managing your Services-as-Software.
But what happens when you need to look closer? What if one small part of your multi-step customer onboarding workflow is failing? Do you really need to redeploy the entire system just to test a single change?
This is where the true power of cli.do shines. Beyond the workflow level, the CLI gives you granular control over the individual building blocks: agentic functions. This post will take you beyond the workflow and into the world of function-level management directly from your terminal.
Before we dive into the commands, let's clarify the distinction:
Managing workflows is about orchestration. Managing functions is about precision engineering. Great developers need to do both.
You might be thinking, "My workflow deploys just fine, why should I care about individual functions?" The answer lies in efficiency and control.
The cli.do tool provides a dedicated suite of commands for interacting with your agentic functions. While a workflow is deployed from a directory, functions are managed by name within that workflow's context.
Let's explore some of the most powerful commands.
First, how do you know which functions are available? Use do function list to see the components of a deployed workflow.
$ do function list --workflow="customer-onboarding-v2"
// Output:
// ✓ Fetching functions for workflow 'customer-onboarding-v2'...
//
// NAME RUNTIME MEMORY LAST MODIFIED
// ----------------------- --------- -------- -----------------------
// 1-validate-signup nodejs18 256MB 2023-10-27T10:00:15Z
// 2-create-user-profile nodejs18 256MB 2023-10-27T10:00:18Z
// 3-send-welcome-email nodejs18 128MB 2023-10-27T10:00:21Z
// 4-update-crm python3.9 128MB 2023-10-27T10:00:24Z
This is the core of function-level testing. Use do function invoke to execute a remote function with a specific payload, bypassing the rest of the workflow.
$ do function invoke 3-send-welcome-email \
> --workflow="customer-onboarding-v2" \
> --payload='{"email": "new.user@example.com", "name": "Alex"}'
// Output:
// ✓ Invoking function '3-send-welcome-email'...
//
// {
// "status": "success",
// "messageId": "msg_f9e8a7b6c5d4e3f2a1b0",
// "recipient": "new.user@example.com"
// }
You get the direct output of your function in seconds. No more console.log debugging and redeploying.
When a function misbehaves, you need its logs. Not the whole workflow's logs, just the ones for the function you're debugging.
# Stream logs in real-time for a specific function
$ do function logs 2-create-user-profile --workflow="customer-onboarding-v2" --tail
This command gives you a clean, isolated view of your function's activity, making it easy to spot anomalies.
Let's put it all together. The customer-onboarding-v2 workflow is failing intermittently.
Check Workflow Logs: You start high-level with do workflow logs customer-onboarding-v2. You see a generic "Internal Server Error" that seems to originate from the CRM update step.
Isolate the Function: You list the functions with do function list and identify 4-update-crm as the likely culprit.
Inspect Function Logs: You zero in on its logs: do function logs 4-update-crm --workflow="customer-onboarding-v2". You spot a KeyError: 'userId' not found in payload message. Aha!
Replicate the Error: You find a sample payload from a failed run and try to replicate the error by invoking the function directly.
$ do function invoke 4-update-crm \
> --workflow="customer-onboarding-v2" \
> --payload='{"user_name": "Alex", "account_id": "acc_123"}'
// Output:
// {
// "status": "error",
// "error": "KeyError: 'userId' not found in payload"
// }
The error is confirmed. The function expects userId, but the previous step is sending user_name and account_id.
Fix and Deploy: You correct the function code locally to handle the incoming data correctly. Because this is a critical fix, you redeploy the whole workflow to ensure consistency. do workflow deploy . --name="customer-onboarding-v2"
In minutes, you went from a vague workflow error to a precise root cause and a deployed fix, all thanks to the granular control provided by the do function command suite.
Deploying agentic workflows from your terminal establishes your architecture. But managing the individual functions within it is how you achieve mastery and operational excellence. By adding do function commands to your toolkit, you gain the speed and precision needed to build, debug, and maintain truly robust and scalable Business-as-Code solutions.
Ready to get started? Install the .do CLI and turn your business logic into simple, powerful command-line operations.