### Use Context7 for AI Grounding Source: https://github.com/slorenzot/context7-llm-omnistudio-patterns/blob/main/README.md Add this command to your prompt in supported AI clients to ground responses in the Omnistudio documentation. ```text use context7 ``` -------------------------------- ### DataRaptor Transform Action with Dual Input Source: https://github.com/slorenzot/context7-llm-omnistudio-patterns/blob/main/04-dataraptor-dual-input.md Configure a DataRaptor Transform Action to accept input from a specific step and merge it with additional fields from other sources. Use 'sendJSONPath' to specify the primary input source and 'additionalInput' to provide supplementary data. ```json { "Name": "Transform_Response", "Type": "DataRaptor Transform Action", "PropertySetConfig": { "additionalInput": { "currentStep": "%DetermineStep:currentStep%", "lead.vehicle_json": "%Extract_VehicleFromInsurableItem:lead:0:vehicle_json%" }, "bundle": "SURADRTransformLeadFullToApiResponse", "sendJSONPath": "Extract_LeadFullState", "sendOnlyAdditionalInput": false, "useFormulas": true } } ``` -------------------------------- ### Conditional Response Action for Success Source: https://github.com/slorenzot/context7-llm-omnistudio-patterns/blob/main/05-failure-detection.md Implement a Response Action that triggers only when a preceding step succeeds. This action defines the success response path. ```json { "Name": "ResponseSuccess", "Type": "Response Action", "PropertySetConfig": { "executionConditionalFormula": "%CreateLead:success% = true", "sendJSONPath": "Transform_Response" } } ``` -------------------------------- ### Orchestrator IP Action Configuration Source: https://github.com/slorenzot/context7-llm-omnistudio-patterns/blob/main/01-orchestrator-worker.md This JSON configuration shows how an Orchestrator IP calls a Worker IP. Set `sendOnlyAdditionalInput` to `true` to pass only necessary fields, preventing implicit data dependencies. ```json { "Name": "CreateLead", "Type": "Integration Procedure Action", "PropertySetConfig": { "additionalInput": { "campaign_id": "%campaign_id%", "documentNumber": "%document_number%", "email": "%email%" }, "integrationProcedureKey": "SURA_LeadCreateLead", "sendOnlyAdditionalInput": true, "useFormulas": true } } ``` -------------------------------- ### Set Values: Compute Input Flags Source: https://github.com/slorenzot/context7-llm-omnistudio-patterns/blob/main/02-guard-clause.md Use the Set Values element to compute boolean flags for each input node and an aggregate flag for overall data presence. Ensure `useFormulas` is set to true. ```json { "Name": "Set_HasData", "Type": "Set Values", "PropertySetConfig": { "elementValueMap": { "hasOwnerData": "=IF(NOT(ISBLANK(%owner:first_name%)),true,false)", "hasVehicleData": "=IF(NOT(ISBLANK(%vehicle:plate%)),true,false)", "hasAnyUpdateData": "=IF(OR(%Set_HasData:hasOwnerData%,%Set_HasData:hasVehicleData%),true,false)" }, "useFormulas": true } } ``` -------------------------------- ### DataPack.json Element Ordering for Guard Clauses Source: https://github.com/slorenzot/context7-llm-omnistudio-patterns/blob/main/02-guard-clause.md Define the correct order of elements in DataPack.json to ensure guard clause components execute before the steps they protect. The Conditional Block and its child Response Action must follow the Set Values step and precede the guarded steps. ```json ["Set_HasData", "If_No_Update_Data", "Response_No_Update_Data", "ValidateLead", "PersonLookup", "MergeData", ...] ``` -------------------------------- ### Conditional Response Action for Errors Source: https://github.com/slorenzot/context7-llm-omnistudio-patterns/blob/main/05-failure-detection.md Implement a Response Action that triggers only when a preceding step fails. This action sends specific error details based on the failure. ```json { "Name": "ResponseError", "Type": "Response Action", "PropertySetConfig": { "executionConditionalFormula": "%CreateLead:success% = false", "sendJSONNode": "error", "sendJSONPath": "CreateLead:result:error" } } ``` -------------------------------- ### Set Values: Compute All Flags Source: https://github.com/slorenzot/context7-llm-omnistudio-patterns/blob/main/03-scenario-validation.md This snippet computes boolean flags indicating the presence of different data types like owner, vehicle, and plan data. It uses formulas to check if specific fields within these data types are not blank. ```json { "Name": "Set_HasData", "Type": "Set Values", "PropertySetConfig": { "elementValueMap": { "hasOwnerData": "=IF(NOT(ISBLANK(%owner:first_name%)),true,false)", "hasVehicleData": "=IF(NOT(ISBLANK(%vehicle:plate%)),true,false)", "hasPlanData": "=IF(NOT(ISBLANK(%plan:code%)),true,false)", "hasPayerData": "=IF(NOT(ISBLANK(%payer:first_name%)),true,false)", "hasPolicyHolderData": "=IF(NOT(ISBLANK(%policy_holder:first_name%)),true,false)" }, "useFormulas": true } } ``` -------------------------------- ### Response Action: Structured Error Output Source: https://github.com/slorenzot/context7-llm-omnistudio-patterns/blob/main/02-guard-clause.md As a child of the Conditional Block, this Response Action returns a structured error when no data is present. Ensure `returnOnlyAdditionalOutput` is true and populate `vlcResponseHeaders` and `additionalOutput.errors`. ```json { "Name": "Response_No_Update_Data", "Type": "Response Action", "ParentElementName": "If_No_Update_Data", "ParentElementType": "Conditional Block", "PropertySetConfig": { "additionalOutput": { "errors": [ { "code": "NO_UPDATE_DATA", "message": "At least one node with data is required." } ] }, "returnOnlyAdditionalOutput": true, "vlcResponseHeaders": { "errors[0].code": "NO_UPDATE_DATA", "errors[0].message": "At least one node with data is required." } } } ``` -------------------------------- ### Conditional Block: Check for Data Presence Source: https://github.com/slorenzot/context7-llm-omnistudio-patterns/blob/main/02-guard-clause.md Implement a Conditional Block that executes only when no relevant data is present, based on the flags computed in the preceding Set Values step. Set `isIfElseBlock` to false for a simple guard clause. ```json { "Name": "If_No_Update_Data", "Type": "Conditional Block", "PropertySetConfig": { "executionConditionalFormula": "%Set_HasData:hasAnyUpdateData% = false", "isIfElseBlock": false } } ``` -------------------------------- ### Error Response: Invalid Scenario Source: https://github.com/slorenzot/context7-llm-omnistudio-patterns/blob/main/03-scenario-validation.md This response action is triggered when an invalid scenario is detected. It returns a specific error code and a message listing the valid scenarios. ```json { "Name": "Response_Invalid_Scenario", "Type": "Response Action", "ParentElementName": "If_Invalid_Scenario", "ParentElementType": "Conditional Block", "PropertySetConfig": { "additionalOutput": { "errors": [ { "code": "INVALID_SCENARIO", "message": "Input does not match any valid scenario. Valid: owner only, vehicle only, plan only, or full data." } ] }, "returnOnlyAdditionalOutput": true } } ``` -------------------------------- ### Detect and Propagate Errors with failureConditionalFormula Source: https://github.com/slorenzot/context7-llm-omnistudio-patterns/blob/main/05-failure-detection.md Use failureConditionalFormula to detect errors from child IPs or Remote Actions and propagate them. The syntax for error fields within failureConditionalFormula uses curly braces. ```json { "Name": "CreateLead", "Type": "Integration Procedure Action", "PropertySetConfig": { "additionalInput": { "campaign_id": "%campaign_id%", "documentNumber": "%document_number%", "email": "%email%" }, "failOnStepError": true, "failureConditionalFormula": "NOT(ISBLANK({%CreateLead:result:error%}))", "failureResponse": { "error": "%CreateLead:result:error%" }, "integrationProcedureKey": "SURA_LeadCreateLead", "sendOnlyAdditionalInput": true, "useFormulas": true } } ``` -------------------------------- ### Deep Merge with Set Values Source: https://github.com/slorenzot/context7-llm-omnistudio-patterns/blob/main/05-failure-detection.md Use dot notation in elementValueMap keys to perform a deep merge, overriding nested fields without a separate merge tool. The order of entries is important for the merge outcome. ```json { "Name": "Merge_VehicleIntoState", "Type": "Set Values", "PropertySetConfig": { "elementValueMap": { "lead": "%Extract_LeadFullState:lead%", "lead:vehicle": "%Extract_VehicleFromInsurableItem:lead:vehicle%" } } } ``` -------------------------------- ### Deserialize JSON String to Object with Set Values Source: https://github.com/slorenzot/context7-llm-omnistudio-patterns/blob/main/05-failure-detection.md Deserialize a JSON string field returned by a DataRaptor Extract into an object. Always wrap DESERIALIZE in IF(ISBLANK(...)) to prevent errors on null values. ```json { "Name": "Set_Deserialized", "Type": "Set Values", "PropertySetConfig": { "elementValueMap": { "response_payer": "=IF(ISBLANK(%Extract_LeadContext:payer_json%), \"\", DESERIALIZE(%Extract_LeadContext:payer_json%))", "response_vehicle": "=IF(ISBLANK(%Extract_LeadContext:vehicle_json%), %Extract_LeadContext:vehicle%, DESERIALIZE(%Extract_LeadContext:vehicle_json%))" }, "useFormulas": true } } ``` -------------------------------- ### Conditional Block: Detect Invalid Scenarios Source: https://github.com/slorenzot/context7-llm-omnistudio-patterns/blob/main/03-scenario-validation.md This conditional block detects invalid input scenarios by evaluating a complex nested IF formula. It returns true if no valid scenario is matched, triggering an error response. ```json { "Name": "If_Invalid_Scenario", "Type": "Conditional Block", "PropertySetConfig": { "executionConditionalFormula": "IF(AND(%Set_HasData:hasOwnerData% = true, %Set_HasData:hasVehicleData% = true), false, IF(%Set_HasData:hasPlanData% = true, false, IF(%Set_HasData:hasOwnerData% = true, IF(%owner:is_same_payer% = true, false, IF(AND(%Set_HasData:hasPayerData% = true, %owner:is_same_payer% = false), false, IF(AND(%Set_HasData:hasPolicyHolderData% = true, %owner:is_same_holder% = false), false, true))), true)))" } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.