How to Pass Subflow Outputs Back to the Main Flow: Resolving Return Value Issues

Describe the problem/error/question

I’m trying to pass final values from a subflow back to the main flow, but it only returns the initial prompt instead.

For example, the main flow requests a blog post, triggering the subflow to generate and revise it. Once the post is approved, a message is supposed to be sent indicating that the blog post has been created. However, instead of receiving the final output or confirmation message from the subflow, the main flow only receives the initial prompt and not the returned value of the subflow.

I couldn’t find any solutions online, so any help would be appreciated!

What is the error message (if any)?

There is no error message. But I don’t get the connection between subflow and main flow. None of the values of subflow is being returned to the mainflow.

Please share your workflow

MAIN FLOW

SUBFLOW

Share the output returned by the last node

Initial Prompt: “Write a letter about the letter m”
Received output: “Write a letter about the letter m”
Expected output: “Blog has been created…!”

Information on your n8n setup

  • n8n version: 1.92.2
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): web app RepoCloud
  • Operating system: Windows
1 Like

Hi @KColab,

Try forcing the output to json and telling the initial bot what the json returned will look like.

Here’s an example.

1 Like

Thank you!!

I tried to wrap my head around how the connections work and your simple workflow has helped me a lot!

I was also not aware that you can call a subworkflow in the same workflow by copying the nodes into the JSON of the main worflow. Great tip!

1 Like

@KColab

Glad itd helped you!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.