Automation & AI · · That Guy Sketch
11 Tips for a Production Agentic Workflow
Moving an AI agent from demo to production? Eleven practical tips: scope, access, approvals, validation, error handling, cost caps, logging, testing and rollback.
A production agentic workflow is an AI-driven process that runs on real data, touches real accounts, and has to keep working when nobody is watching. A demo only has to work once. Production has to work on a bad day.
These eleven tips are the ones we check before we trust an agent with real work. None of them is exotic. Most failures come from skipping a basic one.
1. Define the job and what “done” looks like
Write one sentence for the job, the inputs it gets, the output it must produce, and how you will know it worked. “Handle inquiries” is too vague. “Reply to every new web inquiry within five minutes with a draft that a person approves” is testable.
2. Use a fixed workflow where the steps are known
Not every step needs an agent. If the order of steps never changes, build it as a normal workflow and use the model only for the bounded parts, such as drafting or classifying. Save open-ended agent behavior for work where the path really does vary. Fixed steps are cheaper, faster and easier to debug.
3. Give it the least access it needs
Give each agent only the tools, files and accounts the job requires. Use separate credentials for the agent, not yours. Prefer read-only access until write access is truly needed. If it can delete or send, ask whether it needs to.
4. Put a person in front of anything you cannot undo
Add approval steps before the agent sends an email, posts publicly, spends money, deletes data or changes a customer record. Let it draft and queue, and let a human press the button. You can loosen approvals later for low-risk actions once you trust the results.
5. Validate every output
Ask the model for structured output, such as JSON with named fields, then check it before using it. Reject anything that is missing fields, out of range or the wrong type. Never pass raw model text straight into a payment, a database write or an email address field.
6. Treat outside content as untrusted
Emails, web pages, uploaded files and form messages can contain instructions aimed at your agent. This is called prompt injection. Keep untrusted text separate from your instructions, limit what the agent can do after reading it, and never let content it reads grant new permissions.
7. Plan for failure
Things will time out, rate-limit and return junk. Build in:
- Timeouts so one slow call does not stall everything
- Retries with backoff for temporary errors
- Idempotency, so a retry does not send the same email twice
- A fallback or a hand-off to a person when the agent is unsure
- A stop condition, so loops cannot run forever
8. Control cost and speed
Set a cap on steps, tokens and spend per run and per day, and alert when a run goes over. Route work to the right model: a smaller or local model for routine drafting and sorting, and a stronger model only where quality matters. Cache results you will reuse.
9. Keep memory and context deliberate
Decide what the agent remembers and why. Store important state, such as the customer, the status and the last action, in a database you control, not only in the chat history. Pass in only the context a step needs. Too much context raises cost and makes mistakes more likely. Do not store private data you do not need.
10. Log everything and watch it
Record each run: the input, the steps taken, tools called, outputs, who approved what, cost and time. You need this to debug problems, answer “why did it do that?” and show an audit trail. Alert on failures, unusual cost, and a sudden drop in volume. A workflow that silently stops is worse than one that errors.
11. Test before launch, and roll out in stages
Build a small test set of real examples, including messy and tricky ones. Run it every time you change a prompt, a model or a tool, because small edits can change behavior. Then release in stages: a dry run that only logs, then a pilot on a small share of real work, then full use. Keep versions so you can roll back fast.
Quick production checklist
- The job, inputs, output and success test are written down
- Fixed steps use a normal workflow, and agents are used only where needed
- The agent has its own credentials with least access
- A person approves sends, spends, deletes and posts
- Outputs are validated before use
- Untrusted content cannot give the agent new permissions
- Timeouts, retries, idempotency and a hand-off path exist
- Spend and step caps are set, with alerts
- Memory and state live in a store you control
- Every run is logged, with alerts for failures and silence
- A test set exists, and rollout is staged with a rollback plan
Common mistakes
- Starting with the most autonomous option. Start narrow, then widen.
- Skipping the approval step “just for now.” It tends to stay skipped.
- No test set. You will not notice a regression until a customer does.
- Using your personal login. Use a dedicated account.
- No owner. Someone needs to be named who watches the alerts.
FAQ
What is an agentic workflow?
A process in which an AI model decides some of the steps and uses tools, such as email, files, databases or a browser, to complete a task. Some steps may be fixed, and some chosen by the model.
What is the difference between a workflow and an agent?
In a workflow, you set the path in advance. In an agent, the model chooses the path as it goes. Many good systems mix the two, with a fixed backbone and a model handling bounded steps.
Do I need human approval forever?
Not for every action. Keep it for anything you cannot undo or that affects customers or money. Relax it for low-risk steps once your logs show consistent, correct results.
Which tools can run a production agentic workflow?
Workflow tools such as n8n, plus a model from a cloud provider or a local server, can do it. Self-hosted agents also exist. The tool matters less than the controls above. See our top three AI agents compared.
How long does it take to get one into production?
It depends on the scope and how many systems it touches. A narrow workflow with approvals can be piloted quickly. Wide, autonomous ones take longer to test and trust.
Missing a step?
If you’re missing any steps, give us a call. We can help out. That Guy Sketch designs and builds automation and AI workflows for small businesses, with approvals, logging and rollback built in. Get Started and we will review what you have.