---
title: "Compose and debug workflows"
description: "Learn how ordering, data types, breakpoints, and explicit assumptions make complex recipes trustworthy."
---

> Documentation Index
> Fetch the complete documentation index at: https://help.serialize.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Compose and debug workflows

## Learning objectives

- Treat every operation as a typed transformation
- Choose operation order from the data layers
- Pause before a suspected failure point
- Recognize when an operation expects text, bytes, a number, or structured data
- Reduce an exploratory workflow to the smallest reproducible recipe

## The layer rule

Recipes normally reverse layers from the outside inward. If a compressed value was later Base64-encoded, decoding must happen before decompression:

```text
original text → Gzip → Base64
Base64 text → From Base64 → Gunzip → original text
```

Install [Decode Base64 and Gunzip](/recipes/binary-files/gunzip-base64/) and reverse the two operations. The failed order is useful evidence: Gunzip expects binary data beginning with a Gzip header, not printable Base64 characters.

## Step through intermediate values

Use the workspace step control or add a breakpoint before the operation you want to inspect. At every boundary, record:

- The output type
- A recognizable prefix or structure
- The assumption that justifies the next operation
- Whether the operation could silently normalize or discard data

## Compare two similar inputs

Try [Decode PowerShell EncodedCommand](/recipes/security-analysis/decode-powershell-command/) with and without the `Decode text` step. The Base64 decoder returns the correct bytes, but the wrong character interpretation makes the output look corrupted. The workflow is incomplete until byte encoding is explicit.

## Debugging checklist

1. Confirm the first operation matches the outermost representation.
2. Check delimiters, alphabets, and character encodings.
3. Inspect a short, known sample before processing a large value.
4. Disable later operations until the earliest wrong intermediate value is found.
5. Add operations back one at a time.
6. Replace Magic with the confirmed explicit chain.

## Assignment

Build a workflow that converts a compact JSON document to YAML. Add an unnecessary Base64 decoder at the beginning, observe the failure, and then explain why [JSON to YAML](/recipes/structured-data/json-to-yaml/) needs structured text rather than arbitrary decoded bytes.

Source: https://help.serialize.dev/courses/compose-and-debug/index.mdx
