Chat GovAI

Chat with a GovAI assistant (with optional file upload)

Overview

This node, named "Chat GovAI," enables interaction with a GovAI assistant through chat messages. It supports sending prompts to a specified assistant and optionally uploading a file as part of the conversation. The node creates a new chat thread for each input item, sends the prompt (and file if provided), then waits for and retrieves the assistant's reply.

Common scenarios:

  • Automating conversations with a government-related AI assistant that can process text queries.
  • Uploading documents (e.g., PDFs) to provide context or additional information for the assistant to consider in its response.
  • Integrating GovAI chat capabilities into workflows that require AI-driven assistance or information retrieval.

Practical example:
A user uploads a PDF document containing policy details and asks the GovAI assistant specific questions about it. The node uploads the file, sends the prompt referencing the uploaded file, and returns the assistant’s answer for further processing or display.

Properties

Name Meaning
Assistant ID Identifier of the GovAI assistant to chat with.
Prompt The message or question sent to the assistant.
Timeout (seconds) Maximum time to wait for the assistant's reply before throwing an error (default 30 seconds).
Binary File Property Name of the binary property from the input data that contains a file to upload (optional).
Upload Filename Filename to use when uploading the file to GovAI (default "file.pdf").

Output

The node outputs an array of JSON objects, one per input item, each containing:

  • assistantId: The ID of the assistant used.
  • threadId: The unique identifier of the created chat thread.
  • reply: The assistant's textual response to the prompt.
  • fileId: The identifier of the uploaded file if a file was sent; otherwise, null.

No binary output is produced by this node.

Dependencies

  • Requires an API key credential for authenticating with the GovAI service.
  • Uses the GovAI API endpoint (default: https://ca.govai.com/api).
  • Supports optional proxy configuration and custom CA bundles for HTTPS requests.
  • Relies on the n8n helper method to access binary data from incoming items for file upload.

Troubleshooting

  • Timeout errors: If the assistant does not respond within the specified timeout, the node throws an error indicating no response was received in time. Increase the timeout value if responses are slow.
  • File upload issues: Ensure the binary property name matches the actual binary data property in the input. Incorrect names or missing binary data will cause the file upload step to be skipped or fail.
  • Authentication errors: Verify that the API key credential is correctly configured and has necessary permissions.
  • Network/proxy problems: If using a proxy or custom CA bundle, ensure these settings are correct to avoid connection failures.

Links and References

Discussion