Hi Experts,
Can any one please let me know how to access the variables in child workflow from a parentworkflow?
Regards,
Hanushma
Hi Experts,
Can any one please let me know how to access the variables in child workflow from a parentworkflow?
Regards,
Hanushma
You can’t directly access a parent workflow’s local variables inside a child workflow.
In ISC, the child workflow runs in its own execution context, so if you want the child to use values from the parent, the parent has to pass them explicitly as input when calling the child.
Parent workflow
Child workflow
Let’s say the parent has these values:
{
"identityId": "2c9180841234567890",
"managerId": "2c9180849999999999",
"requestType": "Joiner"
}
When calling the child, send them like this:
{
"input": {
"identityId": "{{$.identityId}}",
"managerId": "{{$.managerId}}",
"requestType": "{{$.requestType}}"
}
}
You can also map directly from the trigger/output of previous steps:
{
"input": {
"identityId": "{{$.trigger.identity.id}}",
"managerId": "{{$.getManager.id}}",
"requestType": "Joiner"
}
}
In the child workflow, use an External Trigger and reference the values like this:
$.trigger.input.identityId
$.trigger.input.managerId
$.trigger.input.requestType
If you want, define them as variables first:
childIdentityId = $.trigger.input.identityId
childManagerId = $.trigger.input.managerId
childReqType = $.trigger.input.requestType
For example, in a comparison or HTTP step:
{
"identityId": "$.trigger.input.identityId",
"type": "$.trigger.input.requestType"
}
Hi Hanushma, Can i know what exactly are you trying to pass?
Thanks Kiran.
But my requirement is I invoke a child Wf from a parent WF, in the child WF i’m defining few variables based on certain conditions and after that I would like access these defined variables in child WF in my parent WF. Is there a way I can do that?
Hi Shnatha,
The requirement is I invoke a child Wf from a parent WF, in the child WF i’m defining few variables based on certain conditions and after that I would like access these defined variables in child WF in my parent WF. Is there a way I can do that?
A practical workaround is to wrap all of those condition-based values into one result object in the child workflow and return that object to the parent, instead of trying to read child-local variables directly. ISC does not expose child workflow locals back to the parent automatically, so the parent can only use what the child explicitly returns.
Example idea:
{
"result": {
"route": "{{#if conditionA}}manager{{else}}owner{{/if}}",
"priority": "{{#if conditionB}}high{{else}}normal{{/if}}",
"notify": "{{#if conditionC}}true{{else}}false{{/if}}"
}
}
Then in the parent workflow, reference the child step output, for example:
{{ $.triggerChildWorkflow.result.route }}
{{ $.triggerChildWorkflow.result.priority }}
{{ $.triggerChildWorkflow.result.notify }}
Compute everything inside the child, package it into a single output payload, and consume that payload in the parent. That usually works much better than trying to pass multiple standalone variables around.
Any sample json for the above please?
You can use this as a example json
{
"result": {
"route": "manager",
"priority": "high",
"notify": true
}
}
Then in the parent:
{{ $.triggerChildWorkflow.result.route }}
{{ $.triggerChildWorkflow.result.priority }}
{{ $.triggerChildWorkflow.result.notify }}
That’s usually the cleanest workaround since parent workflows can only consume what the child explicitly returns.
Let me know if you have further queries on it
SubCheckCampaignReminderDaysWF20260406.json (6.4 KB)
Attached is my child workflow, can you help me on where I can addd this return Json?
Right now your workflow ends after Define Variable 1/2/3, so nothing is returned.
Step 1: Add a final step
"Define Return Payload": {
"actionId": "sp:define-variable",
"attributes": {
"id": "sp:define-variable",
"variables": [
{
"name": "result",
"transforms": [],
"variableA": {
"campaignId.$": "$.defineVariable4.campaignId",
"reminderDays.$": "$.ReminderDaysForNotification",
"sendEmail.$": "$.sendEmail"
}
}
]
},
"nextStep": "End Step - Success",
"type": "Mutation"
}
Step 2: Update your branches
Change:
"nextStep": "End Step - Success"
to:
"nextStep": "Define Return Payload"
for:
• Define Variable 1
• Define Variable 2
• Define Variable 3
Initialize defaults early:
ReminderDaysForNotification = 0
sendEmail = false
And instead of failing on no match, route to Define Return Payload.
Parent usage
$.runChildWorkflow.result.reminderDays
$.runChildWorkflow.result.sendEmail
$.runChildWorkflow.result.campaingId
Thank you for the swift response. Let me try and update
Sure if it solves the problem
Please mark it as a solution
A wise advise refrain from sharing information such as client id and other sensitive information. Mask the data or use placeholders
sure. But still no luck, i’m unable to get the values from child.
{
"name": "Sub_Check_Campaign_Reminder_Days_WF",
"description": "This will check for the number of remider days i.e, 0,10,15",
"modified": "2026-04-05T15:06:32.459951327Z",
"modifiedBy": {
"type": "IDENTITY",
"id": "c411d2c724504dfe9a0ea0e644c9d295",
"name": "hanushma.yalla"
},
"definition": {
"start": "Define Variable 4",
"steps": {
"Compare Timestamps": {
"actionId": "sp:compare-timestamps",
"choiceList": [
{
"comparator": "TimestampEquals",
"nextStep": "Define Variable 1",
"variableA.$": "$.defineVariable[\"5DayDeadLineDate\"]",
"variableB.$": "$.defineVariable.currentdate"
}
],
"defaultStep": "Compare Timestamps 1",
"displayName": "Compare Timestamps for 5Days",
"type": "choice"
},
"Compare Timestamps 1": {
"actionId": "sp:compare-timestamps",
"choiceList": [
{
"comparator": "TimestampEquals",
"nextStep": "Define Variable 2",
"variableA.$": "$.defineVariable[\"10DayDeadLineDate\"]",
"variableB.$": "$.defineVariable.currentdate"
}
],
"defaultStep": "Compare Timestamps 2",
"displayName": "Compare Timestamps for 10 Days",
"type": "choice"
},
"Compare Timestamps 2": {
"actionId": "sp:compare-timestamps",
"choiceList": [
{
"comparator": "TimestampEquals",
"nextStep": "Define Variable 3",
"variableA.$": "$.defineVariable[\"15DayDeadLineDate\"]",
"variableB.$": "$.defineVariable.currentdate"
}
],
"defaultStep": "Define Return Payload",
"displayName": "Compare Timestamps for 15 Days",
"type": "choice"
},
"Define Variable": {
"actionId": "sp:define-variable",
"attributes": {
"id": "sp:define-variable",
"variables": [
{
"description": "",
"name": "currentdate",
"transforms": [
{
"id": "sp:transform:replace:string",
"input": {
"pattern": "T.*",
"replacement": "T00:00:00Z"
}
}
],
"variableA.$": "$.now()"
},
{
"description": "",
"name": "5DayDeadLineDate",
"transforms": [
{
"id": "sp:transform:subtractTime:time",
"input": {
"length": 5,
"unit": "days"
}
},
{
"id": "sp:transform:replace:string",
"input": {
"pattern": "T.*",
"replacement": "T00:00:00Z"
}
}
],
"variableA.$": "$.getCertificationCampaign.deadline"
},
{
"description": "",
"name": "10DayDeadLineDate",
"transforms": [
{
"id": "sp:transform:subtractTime:time",
"input": {
"length": 10,
"unit": "days"
}
},
{
"id": "sp:transform:replace:string",
"input": {
"pattern": "T.*",
"replacement": "T00:00:00Z"
}
}
],
"variableA.$": "$.getCertificationCampaign.deadline"
},
{
"description": "",
"name": "15DayDeadLineDate",
"transforms": [
{
"id": "sp:transform:subtractTime:time",
"input": {
"length": 15,
"unit": "days"
}
},
{
"id": "sp:transform:replace:string",
"input": {
"pattern": "T.*",
"replacement": "T00:00:00Z"
}
}
],
"variableA.$": "$.getCertificationCampaign.deadline"
}
]
},
"displayName": "Days - Define Variable",
"nextStep": "Compare Timestamps",
"type": "Mutation"
},
"Define Variable 1": {
"actionId": "sp:define-variable",
"attributes": {
"id": "sp:define-variable",
"variables": [
{
"description": "",
"name": "ReminderDaysForNotification",
"transforms": [],
"variableA": "5"
},
{
"description": "sendEmail",
"name": "sendEmail",
"transforms": [],
"variableA": "true"
}
]
},
"displayName": "ReminderDays5",
"nextStep": "Define Return Payload",
"type": "Mutation"
},
"Define Variable 2": {
"actionId": "sp:define-variable",
"attributes": {
"id": "sp:define-variable",
"variables": [
{
"description": "",
"name": "ReminderDaysForNotification",
"transforms": [],
"variableA": "10"
},
{
"description": "sendEmail",
"name": "sendEmail",
"transforms": [],
"variableA": "true"
}
]
},
"displayName": "Reminder Days 10",
"nextStep": "Define Return Payload",
"type": "Mutation"
},
"Define Variable 3": {
"actionId": "sp:define-variable",
"attributes": {
"id": "sp:define-variable",
"variables": [
{
"description": "",
"name": "ReminderDaysForNotification",
"transforms": [],
"variableA": "15"
},
{
"description": "sendEmail",
"name": "sendEmail",
"transforms": [],
"variableA": "true"
}
]
},
"displayName": "Reminder Days 15",
"nextStep": "Define Return Payload",
"type": "Mutation"
},
"Define Variable 4": {
"actionId": "sp:define-variable",
"attributes": {
"id": "sp:define-variable",
"variables": [
{
"description": "",
"name": "CampaignId",
"transforms": [],
"variableA.$": "$.trigger.campaignId"
}
]
},
"displayName": "Campaign ID - Variable",
"nextStep": "Define Default Return Values",
"type": "Mutation"
},
"Define Default Return Values": {
"actionId": "sp:define-variable",
"attributes": {
"id": "sp:define-variable",
"variables": [
{
"description": "Default reminder days when no date match occurs",
"name": "ReminderDaysForNotification",
"transforms": [],
"variableA": "0"
},
{
"description": "Default email flag when no date match occurs",
"name": "sendEmail",
"transforms": [],
"variableA": "false"
}
]
},
"displayName": "Initialize Return Defaults",
"nextStep": "Get Certification Campaign",
"type": "Mutation"
},
"Define Return Payload": {
"actionId": "sp:define-variable",
"attributes": {
"id": "sp:define-variable",
"variables": [
{
"description": "Object returned to parent workflow",
"name": "result",
"transforms": [],
"variableA": {
"campaignId.$": "$.defineVariable4.campaignId",
"reminderDays.$": "$.ReminderDaysForNotification",
"sendEmail.$": "$.sendEmail"
}
}
]
},
"displayName": "Define Return Payload",
"nextStep": "End Step - Success",
"type": "Mutation"
},
"End Step - Failure": {
"actionId": "sp:operator-failure",
"displayName": "",
"failureName": "Comparison failed",
"type": "failure"
},
"End Step - Success": {
"actionId": "sp:operator-success",
"description": null,
"displayName": "",
"type": "success"
},
"Get Certification Campaign": {
"actionId": "sp:get-campaign",
"attributes": {
"id.$": "$.defineVariable4.campaignId"
},
"displayName": "",
"nextStep": "Define Variable",
"type": "action",
"versionNumber": 1
}
}
},
"creator": {
"type": "IDENTITY",
"id": "c411d2c724504dfe9a0ea0e644c9d295",
"name": "hanushma.yalla"
},
"trigger": {
"type": "EXTERNAL",
"attributes": {
"clientId": "9db9ca0a-73d5-4add-bad3-3718f3a99a70",
"description": "{\n\"pagination\":\"\",\n\"campaignId\":\"2c1234\"\n}",
"id": "idn:external-http",
"url": "/beta/workflows/execute/external/f879d886-adc2-4867-8754-b40d47a210ef"
}
}
}
Hi @Hanushma Can you share the parent workflow?
I have done the same and in the parent workflow trying to retrieve the values as “$.hTTPRequest2.result.campaingId“, can not share the parent workflow here ![]()
Hi Hanushma,
Is your requirement to send emails for all the campaigns in 5, 10 and 15 days ? If that is the case, then can’t we just create one scheduled workflow which will run every day and compare the deadline for the campaign with today’s date and if it falls in 5, 10 or 15th day , then we can send the notification?
Would this appraoch not work here or do you want to send the emails only for certain campaigns ?
Thank You.
Regards
Vikas.
Hi Vikas,
Considering the step count etc the designw as to have parent-child workflow to send the notifications.
Regards,
Hanushma
Hi Kiran,
The below 2 statemenst are not getting evaluated in the WF
“reminderDays.$”: “$.ReminderDaysForNotification”,
“sendEmail.$”: “$.sendEmail”
AM I missing anything? do we need to mention the definevariable while assigning?
Those two values are created inside Define Variable 1/2/3 or Define Default Return Values, so $.ReminderDaysForNotification and $.sendEmail will not resolve the way you expect in Define Return Payload. Your current child WF shows exactly that pattern.
Child Workflow
{
"steps": {
"Define Variable 1": {
"actionId": "sp:define-variable",
"attributes": {
"id": "sp:define-variable",
"variables": [
{
"name": "result",
"transforms": [],
"variableA": {
"campaignId.$": "$.defineVariable4.CampaignId",
"reminderDays": "5",
"sendEmail": "true"
}
}
]
},
"displayName": "ReminderDays5",
"nextStep": "End Step - Success",
"type": "Mutation"
},
"Define Variable 2": {
"actionId": "sp:define-variable",
"attributes": {
"id": "sp:define-variable",
"variables": [
{
"name": "result",
"transforms": [],
"variableA": {
"campaignId.$": "$.defineVariable4.CampaignId",
"reminderDays": "10",
"sendEmail": "true"
}
}
]
},
"displayName": "Reminder Days 10",
"nextStep": "End Step - Success",
"type": "Mutation"
},
"Define Variable 3": {
"actionId": "sp:define-variable",
"attributes": {
"id": "sp:define-variable",
"variables": [
{
"name": "result",
"transforms": [],
"variableA": {
"campaignId.$": "$.defineVariable4.CampaignId",
"reminderDays": "15",
"sendEmail": "true"
}
}
]
},
"displayName": "Reminder Days 15",
"nextStep": "End Step - Success",
"type": "Mutation"
},
"Define Default Return Values": {
"actionId": "sp:define-variable",
"attributes": {
"id": "sp:define-variable",
"variables": [
{
"name": "result",
"transforms": [],
"variableA": {
"campaignId.$": "$.defineVariable4.CampaignId",
"reminderDays": "0",
"sendEmail": "false"
}
}
]
},
"displayName": "Initialize Return Defaults",
"nextStep": "Get Certification Campaign",
"type": "Mutation"
}
}
}
Then in parent WF, read it like this:
{
"campaignId.$": "$.triggerChildWorkflow.result.campaignId",
"reminderDays.$": "$.triggerChildWorkflow.result.reminderDays",
"sendEmail.$": "$.triggerChildWorkflow.result.sendEmail"
}