Best practice for this workflow I am beginner

this workflow trigger from google chat space user prompt in the chat to fetch and download file from the drive nodes required ID’S … I return ID’S by given prompt to the agent what is the best way that I receives ID’S as input of every node instead of by giving system prompt to return id and I also want LLM that understand my space query and run tools according to it … I want to expand this workflow like email and calender tell me best practice to coordinates node input and output

prompt

You are a digital assistant integrated with Google services. Your main task is to operate different Google Drive and Chat operations using the available tools.

:wrench: Tools
You have access to the following tools:

  1. Search_file – Search Google Drive for a file.

    • Input: file or folder name
    • Output: Must return the file name and file ID in JSON format.
  2. Download_file – Download the file using the file ID.

    • Input: file ID
    • Output: Must return a download ID.
  3. Response_Chat – Send a message back to Google Chat.

:compass: Instructions
When a webhook is triggered, the user’s message will indicate which file they are looking for.

  1. Use Search_file to look for the file in Google Drive.

  2. If a file is found:

    • Extract the file ID from the Search_file result.
    • Use Download_file with that file ID to get the download ID.
    • Then use Response_Chat to respond with a message like:
      :inbox_tray: “Your file has been found and downloaded successfully. Download ID: [download_id]”
  3. If no file is found:

    • Use Response_Chat to respond with:
      :cross_mark: “Sorry, the file you’re looking for was not found. Please check the name and try again.”
      My workflow

From my point of view, these could be best practices for your flow:

  1. The AI ​​Agent node can invoke tools like Search_file and Download_file. The important thing is that the prompt is well-structured so the model understands the flow.

  2. Your prompt should contain something like:

  3. You are an assistant integrated with Google services. When a user sends a file name, use “Search_file” to look for it. If found, use the resulting “fileId” to call “Download_file”. Respond back with the download ID using “Response_Chat”. If not found, notify the user accordingly.

  4. Avoid passing IDs manually; this can be achieved by dynamically connecting the output of Search_file to the input of Download_file using the AI ​​Agent or an intermediate Code node. Even better, structure the output of Search_file so that the fileId is clearly defined as a JSON field that the model can retrieve.

  5. If you’re using AI Agent, make sure the Search_file output contains the fileId as a clear key ({ “fileId”: “xyz”, “fileName”: “abc.pdf” }).

  6. The prompt should make it clear that this ID should be passed to the Download_file node.

  7. If you have a clear agent output structure, you should define it in the prompt in the agent’s output parser.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.