Twitch Stream Live Status Checker using GraphQL - n8n Workflow

Use this efficient n8n workflow to instantly check the live status of any Twitch user via the GraphQL API. This n8n template utilizes the GraphQL n8n node for reliable monitoring and custom alerting.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Content creators who want to automate cross-platform announcements when they go live.

  • Developers building custom Twitch status monitoring tools.

  • Automation specialists needing a reliable API checker using the powerful GraphQL n8n node.

  • Users looking for advanced n8n templates for real-time status updates.

Overview

Determining if a Twitch channel is live is a common requirement for automated systems, allowing users to send alerts or kick off subsequent processes (like starting a recording or posting a social media announcement). This sophisticated n8n workflow provides a robust method using the Twitch internal GraphQL endpoint.

Unlike traditional REST API calls, leveraging GraphQL ensures you retrieve only the exact data needed, making the request highly efficient. This n8n template serves as a foundational component for creating complex monitoring solutions. The logic checks for the presence of the stream object in the response; if it exists, the stream is active. This core logic flow control is handled perfectly by the n8n node structure.

How it Works

This automation is initiated by a manual n8n trigger, though in a real-world scenario, you would likely substitute this with a Cron n8n node or Webhook n8n trigger to run scheduled checks.


  1. Start: The workflow begins with the 'When clicking ‘Test workflow’' n8n trigger.

  2. Define Target: The 'Document' n8n node (a Set operation) initializes the workflow item, specifically setting the twitch variable to the target username (YOUR-TWITCH-USERNAME).

  3. Query Twitch GraphQL: The 'Twitch GraphQL' n8n node sends a carefully crafted GraphQL query to the https://gql.twitch.tv/gql endpoint. It uses the username defined in the previous step to retrieve the stream object details (viewers count, title, type).

  4. Client Identification: Crucially, this n8n node is configured with a client-id header which is a publicly known value used by Twitch for anonymous access, bypassing the need for complex OAuth authentication for simple status checks.

  5. Check Status: The 'Is Online' If n8n node evaluates the results. It checks if the stream object returned in the response ({{ $json.data.user.stream }}) is not empty. If the object contains data (True branch), the user is live. If the object is null or empty (False branch), the user is offline. You would connect subsequent n8n nodes to these branches for customized actions (e.g., sending a Slack message, updating a database, or performing other complex actions within your n8n workflow).

Installation Guide


  1. Import: Copy the provided JSON data and import it into your n8n instance via the 'Workflows' section using the 'New' -> 'Import from JSON' option.

  2. Configuration: Locate the 'Document' n8n node.

  3. Set Username: Change the value assigned to the twitch variable from YOUR-TWITCH-USERNAME to the actual Twitch username you wish to monitor.

  4. Execution: Test the n8n workflow by clicking the 'Test workflow' button on the manual n8n trigger node to ensure the GraphQL query returns the expected data. Remember that to run this automation continuously, you must replace the manual n8n trigger with a time-based or event-based n8n trigger.

Node Details


  • When clicking ‘Test workflow’ (Manual Trigger): The starting n8n trigger for testing the flow structure. It ensures the n8n workflow can be executed manually to verify API connectivity.

  • Document (Set n8n node): Function: Stores the target Twitch username (YOUR-TWITCH-USERNAME) in a variable named twitch. Key Configuration: Sets a simple string assignment for easy reference in downstream n8n nodes.

  • Twitch GraphQL (GraphQL n8n node): Function: Executes the specialized GraphQL query against the Twitch public endpoint to fetch stream data for the defined user. Key Configuration: Uses the Twitch GQL endpoint and includes the necessary fixed client-id header. The query dynamically references the twitch variable from the preceding n8n node.

  • Is Online (If n8n node): Function: Determines the outcome of the status check. It is the central piece of core logic flow control. Key Configuration: Checks if the path data.user.stream is 'notEmpty'. If stream data is present, the condition is true (user is live).

Related n8n Workflows

Free

Nodes: 5 Nodes
Updated: December 26 2025
View all
Created by

Featured*