Description:
I’m currently working with MAF and trying to understand how to properly access and parse the forwardedProps field from the incoming request.
In my use case, the request payload looks like this:
{
"threadId": "894ee3aa-bc48-452f-a0ad-21175ab1a1c1",
"runId": "aa9af314-5e1e-40c2-b0c6-d3f0aa5d128d",
"tools": [],
"context": [],
"forwardedProps": {
"data": {
"document_ids": [
"general_information_sample"
],
"extraction_spec": {
"name": "contact_form_v1",
"description": "Extract structured data for a simple contact form including name, email, company, and description.",
"json_schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": ["string", "null"],
"description": "Full name of the person."
},
"email": {
"type": ["string", "null"],
"description": "Email address of the person."
},
"company": {
"type": ["string", "null"],
"description": "Company name provided by the person."
},
"description": {
"type": ["string", "null"],
"description": "Free text description or message provided in the form."
}
},
"required": ["name", "email", "company", "description"]
}
},
"prefilled_data": {
"name": "copilotKit"
}
},
"source": "main"
},
"state": {},
"messages": [
{
"id": "8a673d30-9729-4f96-ada5-83c59a3587d2",
"role": "user",
"content": "{\"type\":\"form\",\"data\":{...}}"
}
]
}
Questions:
1.Where exactly is forwardedProps exposed within the MAF execution lifecycle (e.g., middleware, workflow, tool context)?
2.What is the recommended way to access it?
Should it be read from context, session, or another abstraction?
3.Is there a built-in or standard way to parse the nested data field (e.g., into a typed object)?
4.Are there any best practices for handling forwardedProps when passing data between frontend (CopilotKit) and backend (MAF)?
Additional Context:
The request is sent from CopilotKit with structured form data.
I want to reliably extract fields like document_ids, extraction_spec, and prefilled_data inside my backend logic (e.g., in tools or workflow nodes).
Any guidance or examples would be greatly appreciated.
Thanks! 🙏
Description:
I’m currently working with MAF and trying to understand how to properly access and parse the forwardedProps field from the incoming request.
In my use case, the request payload looks like this:
Questions:
1.Where exactly is forwardedProps exposed within the MAF execution lifecycle (e.g., middleware, workflow, tool context)?
2.What is the recommended way to access it?
Should it be read from context, session, or another abstraction?
3.Is there a built-in or standard way to parse the nested data field (e.g., into a typed object)?
4.Are there any best practices for handling forwardedProps when passing data between frontend (CopilotKit) and backend (MAF)?
Additional Context:
The request is sent from CopilotKit with structured form data.
I want to reliably extract fields like document_ids, extraction_spec, and prefilled_data inside my backend logic (e.g., in tools or workflow nodes).
Any guidance or examples would be greatly appreciated.
Thanks! 🙏