Activities Reference
Activities Reference
Activities are the building blocks of Reliant workflows. Each activity is a strongly-typed operation that performs a specific task—calling an LLM, executing tools, saving messages, or managing git operations.
This reference documents every activity’s inputs, outputs, and behavior.
CallLLM
Sends a prompt to a language model and streams back a response. This is the primary activity for interacting with LLMs in workflows.
The activity:
- Loads conversation history from the specified thread
- Applies system prompts and tool configurations
- Streams the response in real-time
- Returns tool calls if the model requests them
Inputs
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
thread | string | Yes | - | Thread path for conversation context. Must be a valid thread identifier. |
model | string | No | From workflow | Model ID to use (e.g., claude-4-sonnet, gpt-5). |
temperature | float | No | Model default | Sampling temperature (0.0-1.0). Lower values produce more deterministic output. |
max_tokens | int | No | Model default | Maximum tokens in the response. |
thinking_level | string | No | - | Extended thinking effort: low, medium, or high. Only supported by Claude models. |
tools | bool | No | true | Whether to enable tool use. Set to false for pure text generation. |
tool_filter | string[] | No | All tools | List of tool names to enable. Empty means all available tools. |
system_prompt | string | No | - | Override the default system prompt. Used for ad-hoc LLM calls. |
messages | object[] | No | - | Ephemeral messages to append to conversation (not persisted). See Message Injection. |
response_tools | object[] | No | - | Custom response tools for structured output. |
context_sequence | int | No | Auto | Explicit context sequence (typically set after compaction). |
Outputs
| Field | Type | Description |
|---|---|---|
message.role | string | Always "assistant" |
message.text | string | The text content of the response |
response_text | string | Same as message.text (for convenience) |
tool_calls | ToolCall[] | Array of tool calls requested by the model |
input_tokens | int | Number of input tokens consumed |
output_tokens | int | Number of output tokens generated |
cache_creation_tokens | int | Tokens written to prompt cache |
cache_read_tokens | int | Tokens read from prompt cache |
thinking | object | Extended thinking content and signature (if thinking_level was set) |
ToolCall Structure
id: "toolu_01abc..." # Unique identifier for this tool call
name: "bash" # Name of the tool to execute
input: "{\"command\":...}" # JSON-encoded tool argumentsExample
- id: ask_llm
action: CallLLM
inputs:
thread: "{{thread}}"
model: "claude-4-sonnet"
temperature: 0.7
tools: trueExample with Extended Thinking
- id: deep_reasoning
action: CallLLM
inputs:
thread: "{{thread}}"
model: "claude-4-opus"
thinking_level: high
tools: falseMessage Injection
The messages field allows injecting ephemeral messages into the conversation without persisting them to the database. This is useful for ad-hoc LLM calls like filtering or summarization.
- id: filter_results
action: CallLLM
inputs:
thread: "{{thread}}"
system_prompt: "You are a result filter. Return only relevant items."
messages:
- role: user
content: "Filter these results: {{results}}"SaveMessage
Saves a message to the conversation thread. This activity handles all message types: user input, assistant responses, tool results, and system messages.
The activity:
- Validates message structure based on role
- Assigns ordinal position within the thread
- Tracks token counts for context management
- Creates content blocks (text, images, tool calls, etc.)
Inputs
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
thread | string | Yes | - | Thread path to save the message to |
role | string | Yes | - | Message role: user, assistant, tool, or system |
content | string | Conditional | - | Text content. Required for user messages (unless attachments provided). |
attachments | string[] | No | - | Array of attachment IDs for images or files |
tool_calls | ToolCall[] | No | - | Tool calls from an assistant message |
tool_results | ToolResult[] | Conditional | - | Tool results. Required for tool messages. |
input_tokens | int | No | 0 | Input tokens (for assistant messages) |
output_tokens | int | No | 0 | Output tokens (for assistant messages) |
cache_creation_tokens | int | No | 0 | Cache write tokens |
cache_read_tokens | int | No | 0 | Cache read tokens |
context_sequence | int | No | Auto | Explicit context sequence (set after compaction) |
thinking | object | No | - | Extended thinking content to save |
Outputs
| Field | Type | Description |
|---|---|---|
message.role | string | The saved message’s role |
message.text | string | The saved message’s text content |
message_id | string | Unique identifier of the created message |
thread | string | Thread the message was saved to (for chaining) |
tool_calls | ToolCall[] | Pass-through of tool calls (for routing) |
tool_results | ToolResult[] | Pass-through of tool results (for routing) |
thread_token_count | int | Total tokens in the thread (for compaction decisions) |
message_count | int | Total messages in the thread |
context_sequence | int | Current context sequence number |
Example: Save User Message
- id: save_user_input
action: SaveMessage
inputs:
thread: "{{thread}}"
role: user
content: "{{user_prompt}}"Example: Save Assistant Response
- id: save_response
action: SaveMessage
inputs:
thread: "{{thread}}"
role: assistant
content: "{{nodes.ask_llm.outputs.response_text}}"
tool_calls: "{{nodes.ask_llm.outputs.tool_calls}}"
input_tokens: "{{nodes.ask_llm.outputs.input_tokens}}"
output_tokens: "{{nodes.ask_llm.outputs.output_tokens}}"Example: Save Tool Results
- id: save_tool_results
action: SaveMessage
inputs:
thread: "{{thread}}"
role: tool
tool_results: "{{nodes.execute_tools.outputs.tool_results}}"ExecuteTools
Executes tool calls requested by the LLM. Tools run in parallel (up to 10 concurrent executions) for performance.
The activity:
- Validates each tool call’s JSON input
- Loads project context (working directory, worktree path)
- Executes tools with proper timeout handling
- Emits status updates for UI feedback
- Returns structured results for saving to the thread
Inputs
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
thread | string | Yes | - | Thread context for tool execution |
tool_calls | ToolCall[] | Yes | - | Array of tool calls to execute |
Outputs
| Field | Type | Description |
|---|---|---|
message.role | string | Always "tool" |
message.text | string | Summary of tool results |
tool_results | ToolResult[] | Array of execution results |
thread_token_count | int | Current token count (for compaction decisions) |
total_result_chars | int | Total characters across all results |
ToolResult Structure
tool_call_id: "toolu_01abc..." # Matches the ToolCall.id
name: "bash" # Tool that was executed
content: "output here..." # Tool output (stdout for bash, etc.)
metadata: "{...}" # Optional JSON metadata
is_error: false # Whether execution failedExample
- id: run_tools
action: ExecuteTools
inputs:
thread: "{{thread}}"
tool_calls: "{{nodes.ask_llm.outputs.tool_calls}}"Parallelism
ExecuteTools runs up to 10 tool calls concurrently. This is capped to prevent resource exhaustion from runaway LLM responses. Each tool execution:
- Has independent error handling (one failure doesn’t stop others)
- Recovers from panics gracefully
- Respects context cancellation
Approval
Pauses the workflow and waits for user approval before continuing. Creates an approval record visible in the UI and polls for resolution.
The activity:
- Creates a persistent approval record in the database
- Updates chat state to “needs attention” (triggers UI notification)
- Polls for user response (approve/deny)
- Supports configurable timeout
Inputs
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
title | string | Yes | - | Approval prompt title shown in UI |
description | string | No | - | Detailed description of what’s being approved |
timeout | string | No | "1h" | Duration to wait before timing out (e.g., "30m", "2h") |
actions | object[] | No | - | Custom action buttons (type: approve/deny/modify, label) |
metadata | object | No | - | Additional context stored with the approval |
Outputs
| Field | Type | Description |
|---|---|---|
approval_id | string | Unique identifier for this approval |
status | string | Resolution status: approved, denied, or timeout |
data | object | Approval data including title, description, and any denial reason |
Example
- id: confirm_deploy
action: Approval
inputs:
title: "Deploy to Production"
description: "This will deploy version {{version}} to production servers."
timeout: "30m"Example with Custom Actions
- id: review_changes
action: Approval
inputs:
title: "Review Code Changes"
description: "{{changes_summary}}"
actions:
- type: approve
label: "Approve & Merge"
- type: deny
label: "Request Changes"
- type: modify
label: "Edit Before Merge"Conditional Branching
Use approval status to control workflow flow:
- id: check_approval
if: "{{nodes.confirm_deploy.outputs.status == 'approved'}}"
action: RunStep
inputs:
command: "deploy.sh"Compact
Compresses conversation context when approaching token limits. Generates an LLM-powered summary of the conversation history and starts a new context sequence.
The activity:
- Loads all messages in the current context sequence
- Generates a comprehensive summary using a capable model
- Creates a system message with the summary in a new context sequence
- Preserves important details: files modified, errors encountered, pending tasks
Inputs
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
thread | string | Yes | - | Thread to compact |
session_id | string | No | - | Session identifier (preserved through compaction) |
triggering_message | string | No | - | Message ID that triggered compaction (moved to new context) |
Outputs
| Field | Type | Description |
|---|---|---|
message.role | string | Always "system" |
message.text | string | Generated conversation summary |
new_session_id | string | Session ID (unchanged) |
thread | string | Thread path (unchanged) |
context_sequence | int | New context sequence number (incremented) |
Example
- id: compress_context
action: Compact
inputs:
thread: "{{thread}}"
session_id: "{{session_id}}"Summary Structure
The generated summary follows a structured format:
- Summary - High-level overview
- Key Points - Important concepts and decisions
- Errors and Fixes - Problems encountered and solutions
- Problem Solving - Ongoing troubleshooting
- User Messages - All user requests (preserved verbatim)
- Pending Tasks - Work remaining
- Current Work - What was being done
- Next Step - Suggested continuation
Triggering Compaction
Compaction is typically triggered when thread_token_count exceeds a threshold (default: 160,000 tokens, which is 80% of a 200k context window):
- id: check_context_size
if: "{{nodes.save_response.outputs.thread_token_count > 160000}}"
action: Compact
inputs:
thread: "{{thread}}"RunStep (ExecuteRunStep)
Executes a shell command in the project’s working directory. This is the activity behind the run: shorthand in workflows.
The activity:
- Resolves working directory from chat → project → worktree
- Executes commands in a stateless shell (no environment persistence)
- Captures stdout, stderr, and exit code
- Supports timeout and interrupt handling
Inputs
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
command | string | Yes | - | Shell command to execute |
timeout | int | No | 300000 | Timeout in milliseconds (default: 5 minutes) |
Outputs
| Field | Type | Description |
|---|---|---|
stdout | string | Standard output from the command |
stderr | string | Standard error from the command |
output | string | Combined stdout + stderr |
exit_code | int | Process exit code (0 = success) |
interrupted | bool | Whether execution was interrupted (timeout/cancel) |
duration | int | Execution time in milliseconds |
working_dir | string | Directory where command executed |
worktree_id | string | Worktree ID if used |
worktree_path | string | Worktree path if used |
Example: Using Action
- id: run_tests
action: ExecuteRunStep
inputs:
command: "npm test"
timeout: 600000 # 10 minutesExample: Using Shorthand
The run: shorthand is more concise for simple commands:
- id: run_tests
run: npm testShell Behavior
- Commands run in the user’s default shell (
$SHELLor/bin/bash) - For zsh: sources
~/.zshrcbefore execution - For bash: uses login shell (
-lflag) - Environment variables do NOT persist between steps
- Working directory is always the project root or worktree path
Idempotency
Shell commands are NOT re-executed on activity retry. If Temporal retries the activity (due to worker failure), it returns an error rather than re-running the command. This prevents unintended side effects from duplicate execution.
CreateWorktree
Creates a new git worktree for isolated development. Worktrees allow parallel work on the same repository without branch switching.
Inputs
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | - | Name for the worktree (used in path) |
branch | string | No | Auto-generated | Branch name for the worktree |
base_branch | string | No | Default branch | Branch to base the new worktree on |
copy_files | string[] | No | - | Files to copy from source repo (e.g., .env) |
force | bool | No | false | Recreate if worktree already exists |
session_id | string | No | Chat ID | Session to associate with worktree |
Outputs
| Field | Type | Description |
|---|---|---|
id | string | Unique worktree identifier |
name | string | Worktree name |
path | string | Absolute filesystem path |
branch | string | Git branch name |
base_branch | string | Branch it was created from |
repo_id | string | Repository identifier |
status | string | Worktree status |
Example
- id: create_feature_worktree
action: CreateWorktree
inputs:
name: "feature-auth"
base_branch: "main"
copy_files:
- ".env"
- ".env.local"File Copying
The copy_files parameter searches recursively for matching files. Directory structure is preserved:
- Source:
frontend/.env→ Worktree:<worktree_path>/frontend/.env
GitCommit
Commits staged changes to git with a commit message.
Inputs
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
message | string | Yes | - | Commit message |
files | string[] | No | All changes | Specific files to commit (defaults to git add -A) |
Outputs
| Field | Type | Description |
|---|---|---|
commit_hash | string | SHA of the created commit |
success | bool | Whether commit succeeded |
error | string | Error message if failed |
Example
- id: commit_changes
action: GitCommit
inputs:
message: "feat: add user authentication"Example: Specific Files
- id: commit_config
action: GitCommit
inputs:
message: "chore: update configuration"
files:
- "config/settings.yaml"
- "config/defaults.json"Behavior
- Automatically stages files before committing
- Returns
success: truewith emptycommit_hashif “nothing to commit” - Does NOT re-execute on retry (idempotency protection)
Common Types
ToolCall
Represents a tool invocation request from the LLM.
id: string # Unique identifier (e.g., "toolu_01abc123...")
name: string # Tool name (e.g., "bash", "edit", "grep")
input: string # JSON-encoded argumentsToolResult
Represents the result of executing a tool.
tool_call_id: string # Matches the originating ToolCall.id
name: string # Tool that was executed
content: string # Output content
metadata: string # Optional JSON metadata
is_error: bool # True if execution failedMessageOutput
Standardized message format returned by message-producing activities.
role: string # "user", "assistant", "tool", or "system"
text: string # Message contentError Handling
Activities handle errors in two ways:
Activity Errors
If an activity returns an error, Temporal may retry the activity (depending on retry policy). Some activities like RunStep and GitCommit refuse to re-execute on retry for safety.
Soft Errors
Some activities return success with error information in the output:
GitCommitreturnssuccess: falsewitherrorfieldExecuteToolsreturnsToolResult.is_error: truefor failed tools
Example: Handling Soft Errors
- id: commit
action: GitCommit
inputs:
message: "Update"
- id: handle_failure
if: "{{!nodes.commit.outputs.success}}"
action: SaveMessage
inputs:
thread: "{{thread}}"
role: system
content: "Commit failed: {{nodes.commit.outputs.error}}"Activity Categories
Activities are grouped by category for organization:
| Category | Activities |
|---|---|
| Message Processing | CallLLM, SaveMessage, Compact |
| Tool Execution | ExecuteTools |
| Run Step | ExecuteRunStep |
| Approval | Approval |
| Git | GitCommit, CreateWorktree |
See Also
- Workflows Overview - How to compose activities into workflows
- CEL Expressions - CEL expressions for dynamic values
- Tools Reference - Available tools for
ExecuteTools