🎯 System Actions Guide
Note: This guide is being translated. Some parts may still be in Russian or incomplete.
Complete description of all available actions with their parameters and results.
📋 Table of Contents
- action_hub (1 actions)
- event_processor (1 actions)
- scenario_processor (3 actions)
- storage_hub (1 actions)
- telegram_bot_manager (6 actions)
- tenant_hub (6 actions)
action_hub
Description: Central action hub for routing to services
get_available_actions
Description: Get all available actions with metadata
Input Parameters:
⚙️ Additional Parameters
_namespace(string) (optional) — Custom key for creating nesting in_cache. If specified, data is saved in_cache[_namespace]instead of flat cache. Used to control overwriting on repeated calls of the same action. Access via{_cache._namespace.field}. By default, data is merged directly into_cache(flat caching).
Output Parameters:
result(string) — Result: success, errorerror(object) (optional) — Error structurecode(string) — Error codemessage(string) — Error messagedetails(array) (optional) — Error details (e.g. field validation errors)
response_data(object) — Dict of all available actions with metadata
Usage Example:
# In scenario
- action: "get_available_actions"
params:
# Parameters not requiredevent_processor
Description: Service for processing polling events
process_event
Description: Process polling event
Input Parameters:
data(object) — Raw event from polling
Output Parameters:
result(string) — Result: success, errorerror(object) (optional) — Error structurecode(string) — Error codemessage(string) — Error messagedetails(array) (optional) — Error details
Usage Example:
# In scenario
- action: "process_event"
params:
data: {}scenario_processor
Description: Service for processing events by scenarios
process_scenario_event
Description: Process event by scenarios
Input Parameters:
event_type(string, required, min length: 1) — Event type (message, callback_query, etc.)bot_id(integer, required, min: 1) — Bot ID that received the event
Output Parameters:
result(string) — Processing result (success/error)error(object) (optional) — Error structurecode(string) — Error codemessage(string) — Error messagedetails(array) (optional) — Error details
Usage Example:
# In scenario
- action: "process_scenario_event"
params:
event_type: "example"
bot_id: 123sync_scenarios
Description: Sync tenant scenarios: delete old → save new → reload cache
Input Parameters:
tenant_id(integer, required, min: 1) — Tenant ID for scenario syncscenarios(array (of object)) — Array of scenarios to sync
Output Parameters:
result(string) — Sync result (success/partial_success/error)error(object) (optional) — Error structurecode(string) — Error codemessage(string) — Error messagedetails(array) (optional) — Error details
Usage Example:
# In scenario
- action: "sync_scenarios"
params:
tenant_id: 123
scenarios: []sync_tenant_scenarios
Description: Sync tenant scenarios: parse scenarios/*.yaml + sync to database
Input Parameters:
tenant_id(integer, required, min: 1) — Tenant ID
Output Parameters:
result(string) — Result: success, errorerror(object) (optional) — Error structurecode(string) — Error codemessage(string) — Error messagedetails(array) (optional) — Error details
Usage Example:
# In scenario
- action: "sync_tenant_scenarios"
params:
tenant_id: 123storage_hub
Description: Service for managing tenant storage
sync_tenant_storage
Description: Sync tenant storage: parse storage/*.yaml + sync to database
Input Parameters:
tenant_id(integer, required, min: 1) — Tenant ID
Output Parameters:
result(string) — Result: success, errorerror(object) (optional) — Error structurecode(string) — Error codemessage(string) — Error messagedetails(array) (optional) — Error details
Usage Example:
# In scenario
- action: "sync_tenant_storage"
params:
tenant_id: 123telegram_bot_manager
Description: Service for managing Telegram bot lifecycle
get_telegram_bot_info_by_id
Description: Get Telegram bot info from database by bot_id (with caching)
Input Parameters:
bot_id(integer, required, min: 1) — Bot IDforce_refresh(boolean, optional) — Force refresh cache
⚙️ Additional Parameters
_namespace(string) (optional) — Custom key for creating nesting in_cache. If specified, data is saved in_cache[_namespace]instead of flat cache. Used to control overwriting on repeated calls of the same action. Access via{_cache._namespace.field}. By default, data is merged directly into_cache(flat caching).
Output Parameters:
result(string) — Request resulterror(object) (optional) — Error structurecode(string) — Error codemessage(string) — Error messagedetails(array) (optional) — Error details
response_data(object) — Bot data from databasebot_id(integer) — Bot IDtelegram_bot_id(integer) — Bot ID in Telegramtenant_id(integer) — Tenant IDbot_token(string) — Bot tokenusername(string) — Bot usernamefirst_name(string) — Bot first nameis_active(boolean) — Whether bot is activebot_command(array) — Bot commands
Usage Example:
# In scenario
- action: "get_telegram_bot_info_by_id"
params:
bot_id: 123
# force_refresh: boolean (optional)get_telegram_bot_status
Description: Get Telegram bot status (polling/webhook, activity)
Input Parameters:
bot_id(integer, required, min: 1) — Bot ID
⚙️ Additional Parameters
_namespace(string) (optional) — Custom key for creating nesting in_cache. If specified, data is saved in_cache[_namespace]instead of flat cache. Used to control overwriting on repeated calls of the same action. Access via{_cache._namespace.field}. By default, data is merged directly into_cache(flat caching).
Output Parameters:
result(string) — Request resulterror(object) (optional) — Error structurecode(string) — Error codemessage(string) — Error messagedetails(array) (optional) — Error details
response_data(object) — Bot statusis_polling(boolean) — Whether polling is activeis_webhook_active(boolean) — Whether webhook is activeis_active(boolean) — Whether bot is activeis_working(boolean) — Whether bot is working (polling or webhook)
Usage Example:
# In scenario
- action: "get_telegram_bot_status"
params:
bot_id: 123set_telegram_bot_token
Description: Set Telegram bot token
Input Parameters:
tenant_id(integer, required, min: 1) — Tenant IDbot_token(string|None, optional) — Bot token or null to clear
Output Parameters:
result(string) — Result: success, errorerror(object) (optional) — Error structurecode(string) — Error codemessage(string) — Error messagedetails(array) (optional) — Error details
Usage Example:
# In scenario
- action: "set_telegram_bot_token"
params:
tenant_id: 123
# bot_token: string|None (optional)start_telegram_bot
Description: Start Telegram bot (polling or webhook)
Input Parameters:
bot_id(integer, required, min: 1) — Bot ID
Output Parameters:
result(string) — Result: success, errorerror(object) (optional) — Error structurecode(string) — Error codemessage(string) — Error messagedetails(array) (optional) — Error details
Usage Example:
# In scenario
- action: "start_telegram_bot"
params:
bot_id: 123stop_telegram_bot
Description: Stop Telegram bot
Input Parameters:
bot_id(integer, required, min: 1) — Bot ID
Output Parameters:
result(string) — Result: success, errorerror(object) (optional) — Error structurecode(string) — Error codemessage(string) — Error messagedetails(array) (optional) — Error details
Usage Example:
# In scenario
- action: "stop_telegram_bot"
params:
bot_id: 123sync_telegram_bot
Description: Sync Telegram bot for tenant: parse bots/telegram.yaml + create/update bot + sync commands + start
Input Parameters:
tenant_id(integer, required, min: 1) — Tenant ID
⚙️ Additional Parameters
_namespace(string) (optional) — Custom key for creating nesting in_cache. If specified, data is saved in_cache[_namespace]instead of flat cache. Used to control overwriting on repeated calls of the same action. Access via{_cache._namespace.field}. By default, data is merged directly into_cache(flat caching).
Output Parameters:
result(string) — Result: success, error, not_founderror(object) (optional) — Error structurecode(string) — Error codemessage(string) — Error messagedetails(array) (optional) — Error details
response_data(object) (optional) — Response data (bot_id, action)bot_id(integer) — Bot IDaction(string) — Action performed
Usage Example:
# In scenario
- action: "sync_telegram_bot"
params:
tenant_id: 123tenant_hub
Description: Orchestrator service for managing tenants. Coordinates GitHub sync, delegates parsing and sync to specialized services
get_bot_id_by_tenant_id
Description: Get bot_id by tenant_id and bot type. Database lookup, not tied to messenger type.
Input Parameters:
tenant_id(integer, required, min: 1) — Tenant IDbot_type(string, optional) — Bot type (telegram, later whatsapp etc.). Only telegram supported for now.
⚙️ Additional Parameters
_namespace(string) (optional) — Custom key for creating nesting in_cache. If specified, data is saved in_cache[_namespace]instead of flat cache. Used to control overwriting on repeated calls of the same action. Access via{_cache._namespace.field}. By default, data is merged directly into_cache(flat caching)._response_key(string) (optional) — Custom name for main result field (marked 🔀). If specified, main field will be saved in_cacheunder specified name instead of standard. Access via{_cache.{_response_key}}. Works only for actions that support renaming main field.
Output Parameters:
result(string) — Result: success, errorerror(object) (optional) — Error structure (NOT_FOUND if tenant has no bot of this type)code(string) —message(string) —
response_data(object) —- 🔀
bot_id(integer) — Bot ID in database
- 🔀
Note:
- 🔀 — field that can be renamed via
_response_keyparameter for convenient data access
Usage Example:
# In scenario
- action: "get_bot_id_by_tenant_id"
params:
tenant_id: 123
# bot_type: string (optional)get_tenant_status
Description: Get tenant status from cache: last update date, last error (no bot data)
Input Parameters:
tenant_id(integer, required, min: 1) — Tenant ID
⚙️ Additional Parameters
_namespace(string) (optional) — Custom key for creating nesting in_cache. If specified, data is saved in_cache[_namespace]instead of flat cache. Used to control overwriting on repeated calls of the same action. Access via{_cache._namespace.field}. By default, data is merged directly into_cache(flat caching).
Output Parameters:
result(string) — Result: successresponse_data(object) — Tenant cache datalast_updated_at(string) (optional) — Last successful update datelast_failed_at(string) (optional) — Last failure datelast_error(object) (optional) — Last error object (code, message, details)
Usage Example:
# In scenario
- action: "get_tenant_status"
params:
tenant_id: 123get_tenants_list
Description: Get list of all tenant IDs split into public and system
Input Parameters:
⚙️ Additional Parameters
_namespace(string) (optional) — Custom key for creating nesting in_cache. If specified, data is saved in_cache[_namespace]instead of flat cache. Used to control overwriting on repeated calls of the same action. Access via{_cache._namespace.field}. By default, data is merged directly into_cache(flat caching).
Output Parameters:
result(string) — Result: success, errorerror(object) (optional) — Error structurecode(string) — Error codemessage(string) — Error messagedetails(array) (optional) — Error details
response_data(object) —tenant_ids(array (of integer)) — Array of all tenant IDspublic_tenant_ids(array (of integer)) — Array of public tenant IDssystem_tenant_ids(array (of integer)) — Array of system tenant IDstenant_count(integer) — Total number of tenants
Usage Example:
# In scenario
- action: "get_tenants_list"
params:sync_all_tenants
Description: Sync all tenants (pull from GitHub first, then sync all)
Input Parameters:
Output Parameters:
result(string) — Result: success, partial_success, errorerror(object) (optional) — Error structurecode(string) — Error codemessage(string) — Error messagedetails(array) (optional) — Error details
Usage Example:
# In scenario
- action: "sync_all_tenants"
params:sync_tenant
Description: Sync tenant configuration with database (fetch from GitHub first, then sync)
Input Parameters:
tenant_id(integer, required, min: 1) — Tenant ID to sync
Output Parameters:
result(string) — Result: success, error, timeout, not_founderror(object) (optional) — Error structurecode(string) — Error codemessage(string) — Error messagedetails(array) (optional) — Error details
Usage Example:
# In scenario
- action: "sync_tenant"
params:
tenant_id: 123update_tenant_config
Description: Update tenant config (updates DB, invalidates cache). Only updates provided fields
Input Parameters:
tenant_id(integer, required, min: 1) — Tenant IDai_token(string|None, optional) — AI API token for tenant (optional; if not passed - field unchanged, if null - removed)
Output Parameters:
result(string) — Result: success, errorerror(object) (optional) — Error structurecode(string) — Error codemessage(string) — Error messagedetails(array) (optional) — Error details
Usage Example:
# In scenario
- action: "update_tenant_config"
params:
tenant_id: 123
# ai_token: string|None (optional)