Log function calls and errors to SQL Server
Recipe ToolsDatabaseMarketing
What it does
When someone calls a function, this automation monitors for errors and retrieves function details. It logs the full result to a SQL Server table, and stops the job if an error occurs.
Who it's for
Operations teams who need to track function calls and troubleshoot issues across integrations.
How teams use this
Track all function calls for audit
Log every function call with path and status to SQL Server so the team has a complete record of what ran and when. This is the baseline setup.
Route errors to a monitoring dashboard
Filter logged errors from the SQL Server table and send them to a business intelligence tool so the team can see failure patterns and respond faster.
Escalate critical function failures
Add a condition to check if the function is marked critical, then notify the on-call engineer when those calls fail. Only critical functions trigger the alert.
Archive logs older than 90 days
Set up a scheduled job to move old log rows from the active table to an archive table so performance stays fast. The logging flow itself does not change.
How it works
- Receive a function call. A function is invoked in real time with parameters passed from another integration or system.
- Retrieve function path and details. Get the function path if not already provided, then fetch the full function details from Workato to include in the log entry.
- Insert log row into SQL Server. Write the function call details, path information, and error status to the dbo.AOF_LOGGING table in SQL Server for the record.
- Stop job if error found. If an error was detected during monitoring, stop the job and report the full error message so the issue can be investigated.