[id="troubleshooting-workflows_{context}"] [[_troubleshooting_workflows_]] = Troubleshooting workflows When workflows are not behaving as expected, server logs are the primary tool for understanding what is happening. The workflow engine logs detailed information about workflow lifecycle events, step execution, and errors. == Enabling workflow debug logging By default, the workflow engine logs warnings and errors. To see the full execution flow, enable `DEBUG` level logging for the `org.keycloak.models.workflow` category by setting the following server configuration option: --log-level=org.keycloak.models.workflow:debug This enables debug logging for the workflow engine, all step providers, and the workflow state provider. == What to look for in the logs === Workflow activation and scheduling When a workflow is triggered by an event, the engine logs the activation and scheduling of the first step: * `Workflow '' activated for resource (execution id: )` — the workflow execution has been created and is being processed. * `Scheduled step to run in for resource (execution id: )` — a scheduled step has been queued to run after the specified duration. === Step execution As steps are executed, the engine logs their progress: * `Running step on resource (execution id: )` — a step is about to be executed. * `Step completed successfully (execution id: )` — the step finished without errors. * `Workflow '' completed for resource (execution id: )` — all steps in the workflow have been executed. === Step failures and timeouts When a step fails or the executor times out, the engine logs the error and fires a step failed event. The step will be retried in the next execution cycle (see <<_handling_failures_>> for more details). * `Step failed (execution id: ) - error message: ` — the step threw an exception during execution. * `Workflow executor timed out during execution of step ` — runtime exception indicating that the step exceeded the configured executor task timeout. See <<_understanding_workflows_engine_>> for how to configure the timeout. * `Workflow executor was cancelled during execution of step ` — runtime exception indicating that the executor service was cancelled for a reason other than timeout. === Skipped and cancelled workflows * `Skipping workflow as it is disabled` — the workflow is disabled and will not process events. * `Workflow '' cancelled for resource (execution id: )` — the workflow execution was cancelled. * `Resource is no longer eligible for workflow . Cancelling execution of the workflow.` — the resource no longer meets the workflow conditions upon resuming a scheduled step. === Workflow errors * `Error processing event for workflow : ` — an error occurred while processing the event that triggers the workflow. * `Error resuming workflow for resource : ` — an error occurred while resuming a scheduled workflow execution. * `Could not find step in workflow for resource . Cancelling execution of the workflow.` — the step scheduled to run could not be found in the workflow. === Step-level warnings Individual step providers log warnings when configuration is missing or invalid. Examples include: * `Missing required configuration option '' in ` — a required parameter was not provided in the step's `with` block. * `Invalid required action configured in ` — the required action name is not recognized. * `User has no email address, skipping notification` — the `notify-user` step could not send an email. * `Failed to send notification email to ` — an email delivery failure occurred. == Useful log categories If you need more targeted logging, you can enable debug logging for specific components: [cols="2*", options="header"] |=== |Category |Description | `org.keycloak.models.workflow` | All workflow-related logging (engine, steps, state) | `org.keycloak.models.workflow.DefaultWorkflowProvider` | Workflow engine lifecycle (activation, conditions, event processing) | `org.keycloak.models.workflow.RunWorkflowTask` | Step execution, completion, failures, and timeouts | `org.keycloak.models.workflow.ScheduleWorkflowTask` | Step scheduling and delayed execution |===