I’m exploring using field agents to extract data from documents. I’ve got 7 agents running, each looking for different information (job#, project manager, start date, due date etc). When all of those agents are finished with their tasks, I want to trigger an automation to do stuff with all the data they’ve extracted. How can i do this?
At least with a script, I believe you can use the ‘State’ attribute on each of your Agents so that when there is data in all of them you can run your script (or not).
How about an automation that triggers on “When a record matches conditions” and having seven conditions that each check for “When <agent field> is not empty” ?
How about an automation that triggers on “When a record matches conditions” and having seven conditions that each check for “When <agent field> is not empty” ?
better than my solution, I’d go with this.
I’m checking for ‘not empty’, but in some cases, when document can be changed, so agents will re-Analyze attachment, you may want to change a trigger to “When {Agent field} updated”
An automation looking for certain fields to be “not empty” is how I’d generally approach it as well, but since we’re talking about at least seven different pieces of information (which I assume each have their own field + field agent), I’d also ask the following:
- are your agents running automatically or do you manually trigger them?
- what stuff do you want accomplished with the extracted information? are there different tasks or flows contingent on specific conditions? (i.e. are there any “if this, then that” branches in this process?)
- do you want to build in any human review or verification steps/checkpoints?
- reiterating Alexey’s comment above: if the document is updated or changed, should all or some of the automations run again if the agents return updated values?
- are you looking to run automations on a list of records (documents) already uploaded into a table, or for those agents and then automations to run each time a new document is added? (or both!)
depending on your answers, this could end up needing to be more than one automation.
Hi
In most cases, using a trigger that checks if all seven fields are not empty is a great start. However, here are a couple of caveats to consider:
- Handling Updates After the First Run:
If you want the automation to trigger again when the document is updated in the future, you’ll need a more nuanced approach. Instead of just checking if fields are not empty, you might want to add a formula field that calculates the time difference between the last update of each field and the current time. Then, you can set your automation to trigger only when all fields have been updated within a certain recent time window, say the last five minutes. This ensures that you’re capturing a fresh round of updates rather than just the initial completion. - Handling Potential Errors or Empty Results:
Sometimes an AI field agent might not return the expected data and could insert a placeholder or error message. To prevent the automation from triggering under these conditions, you can instruct the AI to return a specific keyword if it fails to find the relevant info. Then use a formula to check for that keyword and avoid triggering the automation if any field contains it.
In short, by combining a timing formula and a fallback keyword check, you can make sure your automation only runs when all agents are done successfully and recently. Hope this helps!
Btw, I had a similar need, but I created a single prompt for all stuff, and then gather info from it’s result
possible it can use AI more effective, than running many agents, but i don’t know, maybe several little prompts can work better.
Also, I used to Prompt OMNI to gather some info and then fill some fields. So I’m not sure - If I can ask AI to fill other fields within this prompt, or it is better to use automation to fill them.
Example, with some info cut out.
I asked GPT to help create it, with examples of files and info to be retrieved.
“You are an agent that processes documents uploaded.
From each document, extract and fill information with precision. Pay close attention to the specific keywords and formats requested.
1. Parameter1:
Find the 6-digit number that appears immediately after the keywords....
2...(3)..
4. Document Date (Doc date):
Find the primary legal date of the document using this priority order:
First, look for a stamped date near the words (......). This is the highest priority.
If not found, look for a date in the main body of...
If neither of the above is found, use the date next to a signature line (e.g., "Date: 1/17/20").
Crucially, ignore any dates associated with "Date available" or "Printed", as these are system metadata, not legal dates.
Store the date in strict YYYY-MM-DD format.
5. Summary:
Write a concise, 1-2 sentence summary of the document's purpose (e.g., - "Transfer of rights, where one side happily signs away headaches and the other pretends it’s a bargain.", "Notice filed, officially documenting that someone cared enough to file a notice.").
Output Format: Return the extracted information as a single JSON object with the following keys: "Parameter1", "Parameter2", "Parameter3", "Doc date", "Summary"
Files: {File}
And then one-line script step to pass a whole JSON object to next steps, where each Parameter can be used separately. (in my case it’s ‘Update record’ with respective fields)
output.set('result',JSON.parse(input.config().content))
wow thanks for all the answers!
We have a pretty archaic process for creating and distributing work orders. Project managers create tasks and communicate information in word docs, email them to office admin who prints and stuffs department mailboxes.
There’s resistance to changing this process, so I’m intercepting the emails with doc attachments (by adding the Airtable recipient to the distribution list), using an automation to dump the attachment into a new record and having the agents parse out relevant data and using automation to populate the correct fields with that data. But I don’t want that automation to trigger until all the agents are done. The “Is not empty” condition will work. The document is never updated, a new record is created for every new document.
I plan to demo the utility of this once I get enough data in there for decision makers to get a good idea of what it can do…
Thank you all!
Project managers create tasks and communicate information in word docs, email them to office admin who prints and stuffs department mailboxes.
… i think part of my soul just disintegrated into dust reading this.
hopefully Airtable can help you drag them from the 90s and into the present day—godspeed!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.