Automation library · Chat assistants

Telegram bot for crypto exchange trading with OKX

Started by an incoming Telegram message, and works across Telegram. It hands the judgement calls to OpenAI. 46 steps, 7 branches: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAI

46 stepsLarge: read it before trusting it with anything live
7Branches: places the flow splits
0Loops or waits
1Service it connects to

The flow

Starts it 1Model 6Logic 25Service 14

The steps in the order they run, from what starts it.

  1. 1OpenAI Chat Model2Lm Chat Open AiModel
  2. 2Call n8n Workflow ToolTool WorkflowModel
  3. 3Structured Output ParserOutput Parser StructuredModel
  4. 4Telegram triggerTelegram triggerStarts it
  5. 5AI AgentAgentModel
  6. 6Merge callback dataMergeLogic
  7. 7SwitchSwitchLogic
  8. 8Switch order typeSwitchLogic
  9. 9Switch callback actionSwitchLogic
  10. 10Download audio fileTelegramService
  11. 11Introduce to the serviceTelegramService
  12. 12Pass through message textSetLogic
  13. 13Convert callback data to commandSetLogic
  14. 14Prepare limit order bodySetLogic
  15. 15Prepare market order bodySetLogic
  16. 16Reply with order type errorTelegramService
  17. 17Prepare cancel order requestSetLogic
  18. 18Answer to callbackTelegramService
  19. 19OpenAI transcriberOpen AiModel
  20. 20Reply with file download errorTelegramService
  21. 21Normalize text fieldSetLogic
  22. 22Extract callback command entitiesSetLogic
  23. 23Prepare post order requestSetLogic
  24. 24Cancel an orderExecute WorkflowLogic
  25. 25OpenAI intents parserOpen AiModel
  26. 26Place an orderExecute WorkflowLogic
  27. 27If cancelledIfLogic
  28. 28Switch intentSwitchLogic
  29. 29If order was placedIfLogic
  30. 30Reply to cancel order with success messageTelegramService
  31. 31Reply to cancel order with OKX API result TelegramService
  32. 32Prepare list orders requestSetLogic
  33. 33Prepare list assets requestSetLogic
  34. 34Reply with intent parsing errorTelegramService
  35. 35Format order data2CodeLogic
  36. 36Reply to command with OKX error messageTelegramService
  37. 37Delete order info from the chatTelegramService
  38. 38List ordersExecute WorkflowLogic
  39. 39List assetsExecute WorkflowLogic
  40. 40Reply to command with OKX API resultTelegramService
  41. 41Split out ordersSplit OutLogic
  42. 42Reply with assets listingTelegramService
  43. 43IfIfLogic
  44. 44Format order data1CodeLogic
  45. 45Reply with empty orders messageTelegramService
  46. 46Reply with order dataTelegramService

How it's built

Starts on
An incoming Telegram message
Steps
46, with 7 branches
Size
Large: read it before trusting it with anything live
Connects to
Telegram
Model
OpenAI

Questions

What does it need to run?

An n8n account, plus your own Telegram account, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an incoming Telegram message.

Does it use AI?

Yes. It calls OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 46 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

Before you run it

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 46 steps before you point it at anything that matters.