Debugging overview

The following information can help you when debugging Workflows and can assist you in deploying a reliable, predictable, and optimized workflow.

Projects and environments
  • Ideally, to protect your production resources, use separate projects for each of your environments: a project for development tasks; a project for application testing; a staging project where development can be merged into the built system; and a project for your production environment where finalized builds are available.
  • Alternatively, use separate workflows.
Workflow creation
  • You can write your workflow in the Google Cloud console editor or by using a preferred IDE or source code editor.
  • Editing YAML files can be error-prone. Set up autocompletion in your IDE or editor to reduce typos and other common errors when developing your workflow. The Google Cloud console editor for Workflows does provide some YAML and syntax validation, and autocompletion; however, there could be syntax errors that must be fixed and that are only caught at deployment. See YAML indentation.
Workflow deployment
Workflow execution
  • When testing a workflow, you can execute it by using the gcloud CLI or in the Google Cloud console:
  • You can access the workflow execution results in the Google Cloud console or by using the gcloud CLI. If testing from the command line, you'll likely want to view the logs in the Google Cloud console on the Workflow details page.
  • You can retrieve the history of a specified workflow execution as a list of step entries, each entry providing information that can assist you in determining the source of an error or optimizing the performance of a workflow.
  • You can access a workflow's environment information (such as its location or project identifier) using built-in environment variables. Built-in environment variables require no declaration and are available in every workflow execution.
  • Errors thrown during a workflow execution contain tags to help you identify what caused the error.
  • You can check the status of any long-running execution.
  • Each workflow execution automatically triggers at least two execution logs: one at the start of an execution and one at the end. You can view logs in Workflows or in Cloud Logging. To view the logs for a single workflow, use the Logs tab in Workflows. To get an aggregate view of the logs for all of your workflows, use the Logs Explorer page in Cloud Logging.
  • You can send logs to Cloud Logging:
    • By enabling call logging which lets you set a flag so that each call step or exception during the execution of your workflow is logged.
    • By creating custom logs that use the sys.log function in your source.

What's next