Skip to main content

LLM Workflow Commands - Quick Reference

Natural language workflow management via SageChat


Supported Commands

1. CREATE-WORKFLOW

Create a new workflow from scratch.

Example: "Create a workflow that emails me when a Stripe payment is received"

Command Format:

{
"action": "create-workflow",
"payload": {
"name": "Stripe Payment Alert",
"description": "Email notification on payment",
"tasks": [...]
}
}

2. UPDATE-WORKFLOW

Modify an existing workflow's name or description.

Example: "Update the 'Email Campaign' workflow name to 'Nurture Sequence'"

Command Format:

{
"action": "update-workflow",
"payload": {
"workflowId": "workflow-id-here",
"changes": {
"name": "New Name",
"description": "New description"
}
}
}

3. ADD-TASK

Add a new task to an existing workflow.

Example: "Add a Slack notification task to the 'Order Processing' workflow"

Command Format:

{
"action": "add-task",
"payload": {
"workflowId": "workflow-id-here",
"task": {
"taskId": "task_new",
"description": "Send Slack notification",
"taskOrder": 3,
"modules": [...]
}
}
}

4. ADD-MODULE

Add a module to an existing task in a workflow.

Example: "Add an email module to task_1 of the 'User Onboarding' workflow"

Command Format:

{
"action": "add-module",
"payload": {
"workflowId": "workflow-id-here",
"taskId": "task_1",
"module": {
"className": "com.valkyrlabs.workflow.modules.EmailModule",
"moduleType": "action",
"name": "Welcome Email",
"moduleData": "{...}"
}
}
}

5. DELETE-TASK

Remove a task from a workflow.

Example: "Remove task_2 from the 'Data Pipeline' workflow"

Command Format:

{
"action": "delete-task",
"payload": {
"workflowId": "workflow-id-here",
"taskId": "task_2"
}
}

6. CREATE-INTEGRATION-ACCOUNT

Set up API credentials for external services.

Example: "Set up my Stripe integration with API key sk_live_12345"

Command Format:

{
"action": "create-integration-account",
"payload": {
"service": "stripe",
"accountName": "Production Stripe",
"credentials": {
"apiKey": "sk_live_12345"
}
}
}

Supported Services: stripe, aws, sendgrid, openai, slack, github, google


Variable Syntax

Access workflow state and module outputs using double-brace syntax:

{{workflow.state.fieldName}}           - Access workflow state
{{workflow.modules.moduleName.output}} - Access upstream module output

Example:

{
"moduleData": "{\"to\": \"{{workflow.state.email}}\", \"amount\": \"{{workflow.modules.payment.total}}\"}"
}

Module Types

  • trigger: Starts workflow (webhooks, schedules, events)
  • transformer: Processes data (filters, maps, aggregates)
  • action: External API calls (email, payments, storage)

Common ExecModules

ModuleClass NameTypeUse Case
Emailcom.valkyrlabs.workflow.modules.EmailModuleactionSend emails
Stripecom.valkyrlabs.workflow.modules.StripePaymentModuleactionProcess payments
REST APIcom.valkyrlabs.workflow.modules.RestApiModuleactionCall external APIs
Slackcom.valkyrlabs.workflow.modules.SlackModuleactionSend Slack messages
AWS S3com.valkyrlabs.workflow.modules.S3ModuleactionStore/retrieve files
Filtercom.valkyrlabs.workflow.modules.FilterModuletransformerFilter data
Mapcom.valkyrlabs.workflow.modules.MapModuletransformerTransform data

Validation Errors

If your command has errors, you'll see validation messages with QuickFix suggestions:

Example Error:

❌ Workflow Validation Failed

• name: Workflow name is required
💡 Add a descriptive name for the workflow

• tasks[0].modules[0].className: Unknown module: FakeModule
💡 Use one of: EmailModule, StripePaymentModule, RestApiModule...

Tips

Getting Workflow IDs

To reference a workflow, you need its ID. Ask:

  • "What workflows do I have?"
  • "Show me the ID for the 'Email Campaign' workflow"

Integration Accounts

Modules requiring authentication need integrationAccountId:

{
"className": "com.valkyrlabs.workflow.modules.StripePaymentModule",
"integrationAccountId": "uuid-of-stripe-account"
}

Create integration accounts first:

  • "Set up my Stripe integration with API key sk_..."

Task Order

Tasks execute sequentially by taskOrder. Ensure new tasks have appropriate order:

{
"taskId": "task_new",
"taskOrder": 3 // Runs after tasks with order 1, 2
}

Example Conversations

Create & Update

You: "Create a workflow called 'Welcome Email' that sends an email"
Valor: creates workflow
You: "Update the 'Welcome Email' workflow description to 'Onboarding sequence'"
Valor: ✅ Workflow updated

Add Task

You: "Add a Slack notification task to the 'Order Processing' workflow"
Valor: ✅ Task Send Slack notification added to workflow

Create with Integration

You: "Create a workflow that charges $50 via Stripe"
Valor: ❌ Validation failed - Stripe module needs integrationAccountId
You: "Set up my Stripe integration with key sk_test_123"
Valor: ✅ Integration account created
You: "Now create the Stripe workflow using that account"
Valor: ✅ Workflow created


Architecture

User Query → Context Injection → LLM → Command Generation → Validation → Execution → Chat Feedback

Context Injection: Automatically injects ExecModule catalog and schemas when workflow queries detected
Validation: Client-side checks before execution (classNames, syntax, required fields)
Execution: REST API calls (GET, POST, PATCH) to ValkyrAI backend
Feedback: Success/error messages with details


Status: LIVE ✅

All 6 commands are operational in SageChat. Natural language workflow management is production-ready!

N8N Killer Progress: 95% complete - Full CRUD via chat with validation!