Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 63 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,75 @@ export OPENCLAW_URL=http://127.0.0.1:18789
# export OPENCLAW_TOKEN=...
```

In a workflow:
**Basic usage in a workflow:**

```yaml
name: hello-world
steps:
- id: greeting
command: >
openclaw.invoke --tool llm-task --action json --args-json '{"prompt":"Hello"}'
openclaw.invoke --tool llm-task --action json --args-json '{"prompt":"Say hello"}'
```

**Complete example: Jira tickets + LLM summary (as requested in #26)**

This workflow fetches Jira tickets, then uses llm-task to summarize them, and pipes the result to a final step:

```yaml
name: daily-standup
args:
team:
default: "CLAW"
project:
default: "E-commerce"
limit:
default: "30"

steps:
# Step 1: Fetch tickets from Jira
- id: list-tickets
command: >
(jira issues search "project = E-commerce AND status = Todo" --json) 2>/dev/null |
jq '[.[] | {id: .key, title: .fields.summary, priority: .fields.priority.name}]'

# Step 2: Use llm-task to summarize the tickets
- id: summarize
env:
# Pass tickets via env var to avoid shell escaping issues
TICKETS_JSON: "$LOBSTER_ARG_TICKETS"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use step output instead of undefined tickets arg

The daily-standup example says it summarizes tickets fetched in list-tickets, but summarize sets TICKETS_JSON from LOBSTER_ARG_TICKETS even though the workflow defines only team, project, and limit args. In this form, the summarize step does not receive the previous step’s ticket payload, so copy-pasting this example will not actually summarize fetched Jira tickets.

Useful? React with 👍 / 👎.

command: >
openclaw.invoke --tool llm-task --action json --args-json
'{"prompt": "Summarize the top 5 most urgent tickets for the daily standup: $TICKETS_JSON"}'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow shell expansion of ticket payload in prompt

The --args-json value is single-quoted, so /bin/sh treats $TICKETS_JSON as a literal string instead of expanding the environment variable. As written, llm-task receives the text $TICKETS_JSON in the prompt rather than the ticket JSON, so the documented workflow cannot produce the intended summary.

Useful? React with 👍 / 👎.

# Alternative: pipe from previous step using stdin
# stdin: $list-tickets.stdout
# command: >
# openclaw.invoke --tool llm-task --action json
# --args-json '{"prompt": "Summarize these tickets for a daily standup"}'

# Step 3: Output the summary (or send to Slack, email, etc.)
- id: output
command: jq '.result'
stdin: $summarize.stdout
```

**Key points:**

1. **`openclaw.invoke` syntax:** Always use `--tool <tool-name> --action <action> --args-json '<json>'`
2. **Avoid `llm_task.invoke` directly** — it's not a standalone executable. Use `openclaw.invoke --tool llm-task` instead.
3. **Passing data between steps:** Use `stdin: $stepId.stdout` to pipe output, or use env vars (`$LOBSTER_ARG_<NAME>`) for complex JSON.
4. **Shell escaping:** For JSON with quotes, use env vars instead of inline substitution to avoid escaping nightmares.

**Common mistakes to avoid:**

```yaml
# ❌ WRONG: llm_task.invoke is not an executable
command: llm_task.invoke --prompt "Hello"

# ❌ WRONG: --tools (plural) is not valid
command: openclaw.invoke --tools llm-task --action json

# ✅ CORRECT: Use openclaw.invoke with --tool (singular)
command: openclaw.invoke --tool llm-task --action json --args-json '{"prompt":"Hello"}'
```

### Passing data between steps (no temp files)
Expand Down