The connector is not yet in Workato’s community library. Until it is, a Workato admin adds it to your workspace. See Add the connector.
Actions and triggers
Ask an agent keeps the recipe waiting while the agent works, which usually takes a few minutes. The connector checks for the answer every minute or so. Set Wait up to (minutes) for how long to wait; the default is 60. If the agent is still working after that, the step fails with the question ID, so a later Get an answer can read the answer.
The step also fails when the agent could not answer, with the agent’s message and a link to the conversation. Use an error monitor in the recipe to handle both. When it succeeds, Status is
completed, or filtered when the agent declined the question, with the reason in Decline reason.
The answer comes in two forms. Answer is Markdown. Answer (HTML) is the same text formatted for an email body, so use it when you send an email: headings, lists and bold text then show properly.
Both triggers check for tasks every poll interval, 5 minutes by default. Narrow Task status changed with Assignee, Source channel (for example api, for tasks a recipe created) or Tags, and New task with Agent or Assignee.
Connect
- In Wordsmith, open each agent the recipe should hand tasks to, and add API as an intake on its configuration page. The Agent list in Create a task shows only agents with that intake.
- In Wordsmith, open Settings → API keys and create an API key. The connection acts with the access of the person who created the key, so a recipe can do only what that person can do. For recipes that serve a whole team, create the key as a user who can see that team’s work. A key limited to some scopes needs
me:read,agents:read,sessions:read,sessions:write,files:read,files:write,tasks:readandtasks:write, plusdirectory:readfor the Assignee dropdown. - In Workato, add a Wordsmith step to a recipe and create a connection. Choose your Region: Europe or United States.
- Paste the API key, then Connect.
Example: review each new contract request
This recipe sends each new request to an agent and posts the answer back.- Start the recipe from your request system’s New record trigger.
- If the request has a file, download it with that system’s download action. Add Wordsmith → Upload a file with the file’s contents and name.
- Add Wordsmith → Ask an agent:
- Agent: the agent that handles these requests.
- Question: the instruction, with the request’s fields inserted. For example:
Review this NDA request from <Requester>. Counterparty: <Counterparty>. Deadline: <Deadline>. - Files: the File ID from Upload a file.
- Idempotency key: the request’s record ID, so a rerun of the job does not ask twice.
- Add an IF step: Status equals
completed. - Under it, post Answer (HTML) and Conversation link back to the request, or email them to the requester.
- Otherwise, send the requester the Decline reason, so a declined request is not lost.
api, that reads Output files and posts them back.
Add the connector
Until the connector is in the community library, a Workato admin adds it to your workspace as a custom connector:- Ask support@wordsmith.ai for the Workato connector. Support sends a share link or the connector’s source code.
- Open the share link and install the connector. With the source code instead, create a connector under Tools → Connector SDK and paste the code in.
- Release the connector, so recipe builders in the workspace can use it.
Limits
- Ask an agent waits at most as long as Wait up to (minutes). A question that waits on a person’s approval can take days, so use Get an answer to read it later.
- Files the agent created have two links. Download URL expires 5 minutes after the answer arrives, so download it in the next step, and never email it. Link does not expire, but needs Wordsmith sign-in.
- Task status changed starts the recipe once per task and status, even if the task is reopened and completed again. A task completed before the recipe’s start time can start it once if the task changes after that time.
- New task reads open tasks in priority order, at most 500 per check. If you are involved in more open tasks than that, a new low-priority task can be missed.