Telegram CoPilot icon

Telegram CoPilot

Your Personal Telegram CoPilot

Overview

The Create Private Chat operation in the "User" resource of the Telegram CoPilot (TelePilot) n8n node allows you to programmatically initiate a private chat with a specified Telegram user. This is useful for automating direct communication, onboarding new users, or triggering 1:1 conversations as part of larger workflows.

Practical scenarios:

  • Automatically start a private chat with a user after they sign up on your platform.
  • Initiate a conversation with a user to deliver personalized notifications or alerts.
  • Use in customer support flows to open a direct channel between an agent and a client.

Properties

Display Name Type Required Description
User ID String Yes ID of the user with whom to create the private chat.
Force Boolean Yes Whether creation of the private chat should be forced.

Details

  • User ID: The unique identifier of the Telegram user you want to start a private chat with. Example: "122323".
  • Force: If set to true, the node will attempt to force the creation of the private chat even if one already exists.

Output

The output is a JSON object representing the result of the createPrivateChat operation from the Telegram API. The structure typically includes details about the created chat, such as:

{
  "_": "chat",
  "id": <number>,
  "type": { ... },
  "title": <string>,
  "photo": { ... },
  "permissions": { ... },
  // ...other chat properties
}
  • The exact fields depend on the Telegram API's response for the createPrivateChat method.
  • If the operation fails, the output may contain error information.

Dependencies

  • Telegram Account Credentials: You must configure the node with valid Telegram API credentials (apiId, apiHash, and phoneNumber) via the required telePilotApi credential.
  • External Service: Requires access to the Telegram API through the TelePilot backend.
  • n8n Configuration: No special configuration beyond standard credential setup.

Troubleshooting

Common Issues:

  • Invalid User ID: If the provided User ID does not correspond to a valid Telegram user, the operation will fail.
  • Not Authenticated: If your Telegram session is not active, you'll receive an error prompting you to log in again.
  • Session Closed: If the session was closed or terminated, you will see an error message suggesting to re-login.
  • Permission Errors: If your account cannot create private chats with the target user (e.g., due to privacy settings), the operation will fail.

Error Messages & Resolutions:

  • "Please login: https://telepilot.co/login-howto"
    Resolution: Re-authenticate your Telegram account using the provided guide.
  • "Session was closed or terminated. Please login again: https://telepilot.co/login-howto"
    Resolution: Log in again to restore your session.
  • Other errors will generally reflect issues returned by the Telegram API, such as invalid parameters or permission problems.

Links and References


Note: Always ensure your Telegram credentials are valid and that you have permission to interact with the target user.

Discussion