Lookup Function in Dataweave

Lookup Function in Dataweave

  • Lookup function is used to call another flow within a dataweave similar to flow reference
  • It is used to call flow and private flow but not sub-flow.
  • It passes payload only.
  • Lookup function has three parameter as below:

  1. flowName: define the target flow name.
  2. payload:? define payload that sends to target flow.
  3. timeoutMillis: It is an optional parameter. It defines timeout for the execution of target flow and default timeout is 2000 milliseconds.

Success Response:?

?Step 1: ?Here we define the main flow with set payload which has payload ‘ Muleys’.

No alt text provided for this image

Step 2:? Define lookup function in? ‘Calling TargetFlow’ as below:

No alt text provided for this image

Step 3: ?Create a targetFlow where we concate upcoming payload (Muleys) with ‘Hello’ payload.

No alt text provided for this image


No alt text provided for this image

Step 4: After execution, we get success response as? below:

No alt text provided for this image

Error Response:

Step 1: For error, here we added wait for 2 seconds to stop execution of flow(targetFlow) as default timeout is 2 seconds.

No alt text provided for this image

Step 2: After execution,getting timeout as below:

No alt text provided for this image

Step 3:? To increase the execution time of targetFlow, here we define timeout to 3 seconds using the third parameter of the lookup function and get a successful response.

No alt text provided for this image




要查看或添加评论,请登录

Silverline in India的更多文章

社区洞察

其他会员也浏览了