Upload Data Source Block

Hi community — hoping someone has run into this and found a fix.

I’ve built an email-triggered workflow that ingests attachments into a data source. The workflow is:

Email Received → JavaScript Function → Upload Data Source Document → Query Data Source → Generate Text → Send Email

The JavaScript function fetches the attachment URL and writes the file content to a workflow variable using ai.vars.file_content. That part works perfectly — the variable is populated with the full document text in the debugger.

The Upload Data Source Document step then receives {{file_content}} in the Document field. In the debugger it shows:

•	File content resolving correctly (2,971 bytes)
•	“Document processing started” with a real document ID
•	“Document processing complete”
•	“Data source is ready for queries”

Everything looks successful. But when I check the data source in the Explorer panel, the document count never changes. The Query Data Source step immediately following also returns no results from the newly uploaded content.

What I’ve tried:

•	Passing {{attachments}} directly — uploads 97 bytes (just the URL string)
•	Passing {{attachments[0]}} — syntax not supported in MindStudio variable fields
•	Using a Set Variable block to extract the URL — array indexing not supported
•	Using a JavaScript function with ai.vars to fetch and set file_content — variable populates correctly but upload doesn’t persist
•	Watching the data source in real time during a workflow run — document count never moves

Has anyone successfully uploaded documents to a data source programmatically via a workflow? Is there something specific about how the Document field needs to be formatted?

Hi @Guest,

Thanks for the post, and apologies for the inconvenience.

Could you share the Debugger logs for that run? To do that, open the Debugger, select the run, click Share, and reply with the URL:

That will let me take a closer look.

Thank you Alex. See below

https://app.mindstudio.ai/share/debugger/cac5b82e-ad6d-48d0-a9fd-75fc7c9c3a17/4c1c116b-daaa-4011-8c27-0381b8dabab8