SDK Reference
Typescript SDK
Logging

Logging

Hatchet comes with a built-in logging view where you can push debug logs from your workflows. To use this, you can use the ctx.log method. For example:

const workflow: Workflow = {
  id: "logger-example",
  description: "test",
  on: {
    event: "user:create",
  },
  steps: [
    {
      name: "logger-step1",
      run: async (ctx) => {
        for (let i = 0; i < 1000; i++) {
          ctx.log(`log message ${i}`);
        }
 
        return { step1: "completed step run" };
      },
    },
  ],
};

Each step is currently limited to 1000 log lines.