Microfn records each function run under Executions. The execution detail shows the trigger, input, returned output or error, and anything the function wrote to its logs.
Start with the failed execution
Open the function, select Executions, and open the failed run. Check the exception first, then inspect the input shape. Many failures come from assuming a field is always present or from treating a wrapped input as the inner payload.
Add concise logs around identifiers and branch decisions:
export async function main(input: { order?: { id?: string } }) {
const orderId = input.order?.id;
console.log("Processing order", { orderId });
if (!orderId) {
throw new Error("order.id is required");
}
return { processed: orderId };
}
Never log secret values, authorization headers, or whole environment objects. A useful log tells you which safe identifier reached which step.
Deploy and replay
Save the corrected function and wait for deployment. Return to the original execution and click Replay. Microfn moves the captured arguments into the runner so you can execute them against the current deployment.
Compare the new result with the original failure. Replaying is especially useful for incoming webhooks and email triggers because you do not need the sender to emit the event again.