<!-- Hey! The fastest way to find solutions is by using the 🔎 search function at the upper right. If your question hasn't been asked before, please follow the template below. Skip the questions that are not relevant to you. -->
Describe the problem/error/question
Subworkflow creates data to return to caller. Caller never receives it.
I see you’re using the CloudConvert API but I was wondering if you had thought of using the n8n CloudConvert nodespublished by CloudConvert themselves? It may also make your workflow run a little faster because I can see that you’ve added some fixed wait nodes but it might be better to instead wait for CloudConvert’s API to respond when it has completed.
If you’re going to use CloudConvert’s APIs directly when you convert a file, calling the convert API will respond with the created task:
Returns
The created task. You can find details about the task model response in the documentation about the show tasks endpoint.
The CloudConvert API is asynchronous by default. When starting a task, the API responds immediately and you either receive the completed task via webhook notification or via polling.
That could mean that when you call the tasks endpoint, that task might not have actualy completed, so you should have a check and loop back to the Wait and get result node again if the task hasn’t actually completed.
So if you’re using the HTTP nodes, you may want to add some additional if statements that check the status of each task has completed before moving on. Here’s an example:
You may want to think a little how you add your checks. Consider checking the status of a task then adding the delay (rather than the othe way round that you have now).
Also that check seems to be repeated so that could also be another sub-workflow.
if you think that this solved your problem, please mark this as Solved!
The reason I didn’t use cloud convert’s n8n node was only that in order to understand the process, I reached out to the net for examples. The one I found that worked did things the way I’m doing them in my example.
Without addressing the other points which are good and interesting regarding Cloud Convert, I discovered that doing an http request created the same symptom.
So the first http request in the subworkflow does a POST. If I run just that in the subworkflow, the subworkflow does not return with data. For example, you could add a set node after the http request, put some data in it, and have it be the last item executed before returning. In this scenario, too, the subworkflow fails to return the set node data.
So this is a subworkflow data passing issue rather than a cloud convert issue.
Thanks for clarifying. I think I’m having a little trouble in understanding the problem, but I think what I understand is that:
You have a parent workflow that calls this subworkflow (lets call it cloudconvert).
When the subworkflow contains just a POST request, it the subworkflow does not return any data.
When the subworkflow contains all other nodes including a final Set node where the Always Output Data is enabled it does not return data.
So the only reason I can think of that the subworkflow is not returning data is because when called from the parent workflow it actually failed, but then you would see a failure on the Call sub-workflow node like this: