The Simplest Way to Make App Of Apps and Step Functions Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams combine app of apps and step functions to deploy and run cloud workflows. The parent app manages child apps while state machines order the runtime tasks. This setup lets your team ship code changes and run multi-step jobs together. Git holds the desired state for every service. State machines handle retries, wait states, and task order across your cloud accounts. How app of apps and step functions share roles and data The parent app points to a folder of child app manifests in Git. Eac

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Teams combine app of apps and step functions to deploy and run cloud workflows. The parent app manages child apps while state machines order the runtime tasks.

This setup lets your team ship code changes and run multi-step jobs together. Git holds the desired state for every service. State machines handle retries, wait states, and task order across your cloud accounts.

How app of apps and step functions share roles and data

The parent app points to a folder of child app manifests in Git. Each child app deploys a service or a state machine definition. When a developer pushes a change, the controller syncs the child apps.

Still, syncing manifests in random order can break dependent services. That is where state machines help your release process. A deployment hook can trigger a state machine after a sync starts. The state machine checks database migrations, runs smoke tests, and shifts traffic.

To make this work, both systems need clear cloud roles. The deployment controller uses an identity role to write cloud resources. The state machine uses a separate role to invoke tasks and read databases. Data moves between steps as small JSON payloads. Each step reads the input, runs its job, and writes the output.

Never pass raw secrets or sensitive data inside those state payloads. Anyone with read permissions on the state machine history can view payload text. If a payload includes emails, phone numbers, or card numbers, mask those fields. Data masking rewrites matched fields in results before the payload reaches the log.

Common failure modes and how to scope permissions

Many teams fail by giving the parent app one giant admin role. Every child app then inherits those wide permissions across the whole cloud account. If one child app breaks or gets compromised, the blast radius is huge. State machines suffer from the same flaw when they share one execution role.

Shared service accounts also ruin your audit logs. When five state machines use one role, you cannot trace who ran a query. Unlogged database queries from workflow steps create blind spots for security teams. Broad tokens stored in Git or task settings add even more risk.

DPoP (Demonstration of Proof-of-Possession) + Cloud Functions IAM: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

You can fix this by scoping roles down to each child app. Give each child app its own role mapped to a single namespace. Do the same for every state machine in your cloud account. One state machine should only invoke the exact functions it needs.

Lock down the network paths between your cluster and your cloud services too. Keep the deployment controller on a private subnet with strict outbound rules. Use private endpoints so state machines talk to databases without touching the public internet. Map every workflow step to a narrow role with short session limits.

Keeping deployment syncs and workflow runs in sync

Drift happens when a state machine changes a resource that Git also tracks. Avoid this conflict by splitting ownership between the two tools. Let the app of apps pattern own static resources like roles and tables. Let state machines own runtime work like data jobs and batch tasks.

When a state machine needs to update a service tag, write it back to Git. The child app will see the commit and sync the change cleanly. This keeps your Git history accurate and prevents endless sync loops.

Good logging across both tools makes debugging much faster for the whole team. Send controller sync events and state machine step logs to one central place. Tag every log line with the commit hash and the workflow run ID. When a step fails, engineers can trace it back to the exact commit.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Should the parent app deploy the state machines directly?

No, the parent app should only point to child apps. Dedicate a specific child app to deploy each state machine and its roles.

How do we stop state machines from leaking data in logs?

Keep sensitive data out of step payloads and use references instead. Apply data masking to rewrite emails, card numbers, or national IDs in query results.

How do we handle rollbacks when a workflow step fails?

Build catch blocks into your state machine to run cleanup tasks on failure. Have the final failure step alert your controller to halt or revert the sync.

The query runs. The emails stay hidden.