Reusable workflow depth error

This week, I started getting a workflow depth error on my reusable workflows (called with workflow_call). Here’s the error:

[ Invalid workflow file : .github/workflows/my_workflow.yaml#L1]

error parsing called workflow “example/example/.github/workflows/my_workflow.yaml@master”: workflow is invalid: job “a job name” calls workflow “example/example/.github/workflows/my_workflow_reusable.yaml@master”, but doing so would exceed the limit on called workflow depth of 2

What’s going on here? I see zero documentation anywhere about this error.

If I kick off a run of my_workflow.yaml, it runs fine. This error only appears when I run my reusable workflow.

1 Like

Based on the error message alone, it appears my_workflow_reusable.yaml is calling another workflow, which is not permitted.

Reusable workflows can’t call other reusable workflows.
Reusing workflows

If this is not the case, could you share your workflows?

Sure thing!

The reusable workflow is:

on: [workflow_dispatch, push, pull_request]

    uses: example/example/.github/workflows/my_workflow_reusable.yaml@master_copy
      SECRET_ONE: ${{ secrets.ONE }}
      SECRET_TWO: ${{ secrets.TWO }}
      SECRET_THREE: ${{ secrets.THREE }}
      SECRET_FOUR: ${{ secrets.FOUR }}

As I was typing this out, I see my error. I called the reusable workflow from itself :man_facepalming: I’m now calling the correct workflow and it’s working. If anyone else has this problem, you may have done the same.

Thank you for your help, @mcaskill!

Dear Github, is there any chance of lifting that constraint? It reduces the composability of workflows a lot.


Just hit this today, expecting it to just work. . . would be super cool to support this. I am the biggest fan of GitHub Actions. . . you can be this awesome. Add this feature and I will upvote every positive community post for a week!

OK, maybe not, I’ll be an even bigger GHA fan.