Microsoft Teams F456 Audio Trigger icon

Microsoft Teams F456 Audio Trigger

Démarre le workflow quand un webhook audio est appelé avec construction de chemin F456

Overview

This node implements a webhook trigger designed to start an n8n workflow when it receives an audio-related webhook call from a Microsoft Teams F456 integration. It constructs a specific webhook URL path based on a company code and a user-defined path component.

The node authenticates incoming requests using an API key header, processes multipart form-data payloads containing audio files and JSON metadata, and can automatically download and play PCM audio files through a backend API when certain call statuses are detected (e.g., "call_received" or "error").

Common scenarios:

  • Automating workflows triggered by incoming calls in Microsoft Teams with custom audio playback.
  • Playing welcome or error audio messages dynamically during call events.
  • Integrating Teams call events with other systems via webhook-triggered workflows.

Practical example:
A company wants to greet callers with a random welcome audio message when a call is received and play an error message if the call encounters an issue. This node listens for such call events, downloads the appropriate audio file(s), and instructs a backend service to play them during the call, while triggering further automation in n8n.


Properties

Name Meaning
Company Code The 6-digit company code used as part of the webhook URL path. Must be exactly 6 digits (e.g., "001000").
Path The path component appended to the webhook URL after the company code (default: "webhook").
Audio Welcome URLs A list of URLs pointing to PCM audio files to download and play when the call status is "call_received". Multiple URLs can be provided; one is randomly selected.
Audio Error URL A single URL pointing to a PCM audio file to download and play when the call status is "error".
Backend URL The base URL of the backend API responsible for playing audio files during calls (default: "https://voip.test.factory456.com").

Output

The node outputs JSON data representing the webhook request details and any processed audio information:

  • For standard webhook calls without multipart data, the output JSON includes:

    • headers: HTTP headers of the request.
    • params: URL parameters.
    • query: Query string parameters.
    • body: The raw body content.
    • method: HTTP method used.
    • url: Full request URL.
  • For multipart/form-data requests containing audio and JSON files:

    • The JSON output merges parsed JSON file content with _webhookInfo metadata about the request.
    • If audio processing occurs (on "call_received" or "error" status), an _audioProcessing object is added with:
      • status: "processed" or "error".
      • audioType: "welcome" or "error".
      • selectedUrl: The URL of the audio file played.
      • callId: Identifier of the call.
      • timestamp: ISO timestamp of processing.
      • In case of errors, error details are included.
  • Binary data fields contain the uploaded audio files from the webhook request.


Dependencies

  • Requires an API key credential configured in n8n for authentication of incoming webhook requests.
  • Uses the axios library to download audio files and send audio playback requests to the backend.
  • Uses the form-data library to construct multipart POST requests for audio playback.
  • The backend service specified by the "Backend URL" property must expose an API endpoint to accept audio playback commands for calls.
  • Node expects incoming webhook requests to include an X-Auth-Key header matching the configured API key.
  • Node reads local filesystem temporarily to parse JSON files attached in the webhook payload.

Troubleshooting

  • Authentication errors:
    If the webhook request lacks the correct X-Auth-Key header or the API key is not configured, the node responds with HTTP 401 or 500 errors respectively.
    Resolution: Ensure the API key credential is set up correctly and clients send the proper header.

  • Invalid company code or path:
    The webhook URL path depends on these properties. Incorrect values will cause webhook calls to miss the node.
    Resolution: Verify the company code is exactly 6 digits and the path matches the expected value.

  • Audio playback failures:
    Errors downloading audio files or sending playback requests to the backend are logged and cause the audio processing step to fail silently (workflow continues).
    Resolution: Check that audio URLs are valid and accessible, and that the backend URL is reachable and supports the required API.

  • JSON parsing errors:
    If attached JSON files are malformed, the node logs errors and includes error details in the output JSON under jsonFileError.
    Resolution: Validate JSON files before sending.

  • Unsupported call status:
    Only "call_received" and "error" statuses trigger audio playback. Other statuses are ignored.
    Resolution: Confirm the external system sends supported statuses.


Links and References

Discussion