Instagram Webhook icon

Instagram Webhook

Recebe eventos do Instagram em tempo real. Saídas organizadas por tipo de evento.

Instagram Webhook

AI-generated

Overview

This node implements an Instagram Webhook trigger for n8n workflows. It receives real-time events from Instagram such as direct messages, comments on posts or reels, mentions in posts and stories, message reactions, standby messages, and other unknown or debug events. The node processes incoming webhook payloads, filters events based on user configuration, prevents infinite loops by ignoring outgoing messages, and organizes events into six separate outputs by event type. This node is useful for automating Instagram interactions, monitoring user engagement, and integrating Instagram data into broader automation workflows.

Use Case Examples

  1. Automatically respond to Instagram direct messages by connecting the 'Mensagens' output to a chatbot node.
  2. Monitor and analyze comments on Instagram posts by connecting the 'Comentários' output to a sentiment analysis or moderation workflow.
  3. Track mentions in posts and stories to trigger marketing campaigns or alerts by using the 'Menções' output.
  4. Log and react to message reactions for customer engagement tracking using the 'Reações' output.

Properties

Name Meaning
Saídas Organizadas Notice explaining the six separate outputs of the node, each corresponding to a different Instagram event type.
Configuração do Webhook Notice providing step-by-step instructions to configure the Instagram webhook URL and verify token in the Facebook Developer portal.
Filtrar Eventos Boolean to enable filtering of specific event types to process.
Tipos de Eventos Multi-select list of Instagram event types to process when filtering is enabled. Events not selected will be ignored.
Logs Detalhados Boolean to enable detailed logging in the server console for debugging and monitoring.
🛡️ PROTEÇÃO ANTI-LOOP Notice explaining the anti-loop protection feature that prevents infinite loops by ignoring messages sent by the user and processing only received messages.
Ignorar Mensagens Enviadas (Anti-Loop) Boolean to enable ignoring messages sent by the user to avoid infinite loops. Enabled by default and recommended to keep enabled.

Output

JSON

  • event_type - Type of Instagram event, e.g., instagram_message, instagram_comments, instagram_mentions, instagram_message_reactions, instagram_standby, instagram_unknown
  • platform - Platform identifier, always 'instagram'
  • entry_id - Unique identifier for the webhook entry
  • timestamp - Timestamp of the event
  • message - Details of direct messages including message ID, text, attachments, sender and recipient info (for messaging events)
  • comment - Details of comments including comment ID, media ID, text, user info, and reply status (for comments events)
  • mention - Details of mentions including mention ID, media ID, and comment ID (for mentions events)
  • reaction - Details of message reactions including emoji or reaction type (for reactions events)
  • standby - Details of standby messages (for standby events)
  • postback - Details of postback events if any
  • user - Additional user information such as username, name, and profile picture URL fetched from Instagram API
  • fromUsername - Username of the user who triggered the event
  • fromName - Name of the user who triggered the event
  • fromProfilePicture - Profile picture URL of the user who triggered the event

Dependencies

  • An API key credential for Instagram Automation API with access token and webhook verify token

Troubleshooting

  • Ensure the webhook URL is correctly configured in the Facebook Developer portal with the correct callback URL and verify token.
  • Verify that the Instagram Automation API credentials are valid and have the necessary permissions.
  • If no events are processed, check if event filtering is enabled and if the event types selected match the incoming events.
  • Anti-loop protection may block messages sent by the user; disable only if custom logic requires processing outgoing messages.
  • Rate limiting is applied per user to avoid excessive processing; if events are blocked due to rate limits, wait for the reset period before retrying.

Links

Discussion