Skip to content

Conversation

@yilmaztayfun
Copy link
Contributor

@yilmaztayfun yilmaztayfun commented Jan 26, 2026

Introduces a comprehensive busy state (subType: 5) test for deeply nested subflow workflows. Adds new tasks, workflow definitions, state diagrams, C# mapping scripts, and a detailed README explaining the busy state pattern, subprocess triggering, and test steps. Updates diagrams and HTTP test scripts to support and document the new busy state and subprocess trigger pattern.

Summary by Sourcery

Add a grandchild busy-state test workflow and supporting subprocess, tasks, mappings, and view/extension definitions to validate the new Busy (subType: 5) behavior in deeply nested subflows.

New Features:

  • Introduce a busy-state grandchild workflow and companion subprocess workflow to exercise subType: 5 behavior in nested subflows.
  • Add new SubProcess and DirectTrigger tasks plus C# mapping scripts to launch a background subprocess and auto-trigger the parent workflow out of busy state.
  • Provide a dedicated grandchild workflow view and data extension mapping to support deep nested view and long-polling tests.
  • Document the busy-state pattern and end-to-end test flow in a new Busy State Test README.

Enhancements:

  • Extend existing subflow test workflows and HTTP test scripts to include busy-state transitions and verification steps for the grandchild workflow.
  • Add a child-to-grandchild subflow mapping to better manage data flow and results across the three-level subflow hierarchy.

Build:

  • Update @burgan-tech/vnext-schema dependency to a version that recognizes new state subType values such as Busy (5) and Human (6).

Documentation:

  • Add Busy State Test implementation documentation detailing the busy-state pattern, subprocess triggering, and testing steps for nested subflows.

Tests:

  • Expand subflow HTTP test sequence to cover entering, observing, and completing the new busy grandchild state driven by the subprocess trigger.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for busy state workflows enabling independent subprocess execution
    • Introduced three-level nested workflow testing capability with automatic state transitions
    • Enhanced long-polling functionality for complex workflow hierarchies
  • Documentation

    • Added comprehensive test scenarios and guides for nested subflows and busy state patterns
  • Chores

    • Updated schema package dependencies to latest stable version

✏️ Tip: You can customize this high-level summary in your review settings.

Introduces a comprehensive busy state (subType: 5) test for deeply nested subflow workflows. Adds new tasks, workflow definitions, state diagrams, C# mapping scripts, and a detailed README explaining the busy state pattern, subprocess triggering, and test steps. Updates diagrams and HTTP test scripts to support and document the new busy state and subprocess trigger pattern.
@yilmaztayfun yilmaztayfun self-assigned this Jan 26, 2026
@sourcery-ai
Copy link

sourcery-ai bot commented Jan 26, 2026

Reviewer's Guide

Implements a new grandchild busy-state (subType: 5) workflow test pattern, including supporting subprocess workflow, tasks, C# mapping scripts, view/extension definitions, updated HTTP test flow, diagrams, and schema package upgrade to recognize the new state subtype.

Sequence diagram for grandchild busy-state subprocess workflow test

sequenceDiagram
    actor Tester
    participant ParentWorkflow
    participant ChildWorkflow
    participant GrandchildWorkflow
    participant StartBusySubprocessTask
    participant BusySubprocessWorkflow
    participant TriggerBusyCompletionTask

    Tester->>ParentWorkflow: Start subflow-view-test-parent
    ParentWorkflow->>ChildWorkflow: Invoke child subflow
    ChildWorkflow->>GrandchildWorkflow: Invoke grandchild subflow

    GrandchildWorkflow->>StartBusySubprocessTask: Execute start-busy-subprocess-task
    StartBusySubprocessTask->>BusySubprocessWorkflow: Start busy-subprocess-workflow
    BusySubprocessWorkflow-->>GrandchildWorkflow: Mark grandchild as busy subType_5

    BusySubprocessWorkflow-->>TriggerBusyCompletionTask: Signal completion condition
    TriggerBusyCompletionTask->>GrandchildWorkflow: trigger-busy-completion-task
    GrandchildWorkflow-->>ChildWorkflow: Return grandchild result
    ChildWorkflow-->>ParentWorkflow: Return child result
    ParentWorkflow-->>Tester: Test run completed with busy-state verified
Loading

State diagram for grandchild busy-state (subType 5) lifecycle

stateDiagram-v2
    [*] --> GrandchildIdle

    GrandchildIdle --> StartingBusySubprocess: Execute_start-busy-subprocess-task
    StartingBusySubprocess --> BusySubType5: busy-subprocess-workflow_started

    BusySubType5 --> AwaitingBusyCompletion: Busy_subprocess_running
    AwaitingBusyCompletion --> BusyCompletionTriggered: Execute_trigger-busy-completion-task

    BusyCompletionTriggered --> GrandchildCompleted: GrandchildCompleteMapping_applied
    GrandchildCompleted --> [*]

    BusySubType5 --> GrandchildFailed: Error_in_busy_subprocess
    GrandchildFailed --> [*]
Loading

Flow diagram for parent, child, grandchild and busy subprocess components

flowchart LR
    subgraph ParentLayer
        PWF[subflow-view-test-parent workflow]
    end

    subgraph ChildLayer
        CWF[subflow-view-test-child workflow]
        C2GMapping[ChildToGrandchildSubFlowMapping.csx]
    end

    subgraph GrandchildLayer
        GWF[subflow-view-test-grandchild workflow]
        GView[grandchild-workflow-view.json]
        GDataExt[grandchild-data-extension.json]
        GStartMap[GrandchildStartMapping.csx]
        GCompleteMap[GrandchildCompleteMapping.csx]
        TriggerParentMap[TriggerParentBusyCompletionMapping.csx]
    end

    subgraph BusySubprocessLayer
        BusyWF[busy-subprocess-workflow.json]
        BusyStartMap[BusySubprocessStartMapping.csx]
        StartBusyTask[start-busy-subprocess-task.json]
        TriggerBusyTask[trigger-busy-completion-task.json]
    end

    PWF --> CWF
    CWF --> C2GMapping
    C2GMapping --> GWF

    GWF --> GView
    GWF --> GDataExt

    GWF --> GStartMap
    GStartMap --> StartBusyTask
    StartBusyTask --> BusyStartMap
    BusyStartMap --> BusyWF

    BusyWF --> TriggerBusyTask
    TriggerBusyTask --> GCompleteMap
    GCompleteMap --> GWF

    GWF --> TriggerParentMap
    TriggerParentMap --> CWF
    CWF --> PWF
Loading

File-Level Changes

Change Details Files
Add busy-state grandchild workflow and supporting subprocess workflow for deep subflow testing.
  • Create busy-subprocess workflow definition with processing, trigger-parent, and completed states to run while the grandchild is busy.
  • Introduce subflow-view-test-grandchild workflow definition that adds a BUSY (subType: 5) state and a follow-up state to resume normal processing.
  • Add corresponding diagram JSON files for the busy subprocess, grandchild, child, and parent workflows to document the new flow.
core/Workflows/subflow-test/busy-subprocess-workflow.json
core/Workflows/subflow-test/subflow-view-test-grandchild.json
core/Workflows/subflow-test/.meta/busy-subprocess-workflow.diagram.json
core/Workflows/subflow-test/.meta/subflow-view-test-grandchild.diagram.json
core/Workflows/subflow-test/.meta/subflow-view-test-parent.diagram.json
core/Workflows/subflow-test/.meta/subflow-view-test-child.diagram.json
Introduce tasks and mapping scripts to launch the busy subprocess and trigger parent completion from the subprocess.
  • Add SubProcessTask and DirectTriggerTask JSON definitions to start the busy subprocess and trigger the parent transition.
  • Implement StartBusySubprocessMapping to configure and launch the busy subprocess when the grandchild enters the busy state.
  • Implement BusySubprocessStartMapping to initialize subprocess instance data used to call back the parent.
  • Implement TriggerParentBusyCompletionMapping to configure DirectTriggerTask and handle the response when triggering the parent's complete-busy-state transition.
core/Tasks/subflow-test/start-busy-subprocess-task.json
core/Tasks/subflow-test/trigger-busy-completion-task.json
core/Workflows/subflow-test/src/StartBusySubprocessMapping.csx
core/Workflows/subflow-test/src/BusySubprocessStartMapping.csx
core/Workflows/subflow-test/src/TriggerParentBusyCompletionMapping.csx
Extend grandchild subflow behavior and data flow for deep nested view/extension testing.
  • Add ChildToGrandchildSubFlowMapping to prepare input data for the grandchild and process its completion output back to the child workflow.
  • Add GrandchildStartMapping and GrandchildCompleteMapping to initialize and finalize the grandchild workflow, including metadata about nesting level and test results.
  • Add grandchild workflow view and data extension definitions and mapping to test long-polling and extension data for deeply nested workflows.
core/Workflows/subflow-test/src/ChildToGrandchildSubFlowMapping.csx
core/Workflows/subflow-test/src/GrandchildStartMapping.csx
core/Workflows/subflow-test/src/GrandchildCompleteMapping.csx
core/Views/subflow-test/grandchild-workflow-view.json
core/Extensions/subflow-test/grandchild-data-extension.json
core/Extensions/subflow-test/src/GrandchildDataExtensionMapping.csx
Document and wire the busy-state test scenario into existing HTTP test flow and configuration.
  • Add BUSY-STATE-TEST-README explaining the busy state pattern, subprocess triggering behavior, API calls, and expected data structures.
  • Extend subflow-view-test.http with steps to drive and validate the busy-state scenario across parent/child/grandchild.
  • Update workflow and task configs as needed in vnext.config.json and ensure lockfile reflects new assets.
core/Workflows/subflow-test/BUSY-STATE-TEST-README.md
core/Workflows/subflow-test/subflow-view-test.http
vnext.config.json
package-lock.json
core/Workflows/task-test/error-boundary-test-workflow.json
core/Workflows/subflow-test/subflow-view-test-child.json
Upgrade schema dependency to support new state subType values (Busy/Human).
  • Bump @burgan-tech/vnext-schema dependency and devDependency from 0.0.28 to 0.0.33 in package.json.
  • Regenerate package-lock.json to align with the new schema version.
package.json
package-lock.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link

coderabbitai bot commented Jan 26, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Introduces a three-level nested subflow architecture with grandchild workflow support, including busy-state subprocess handling, automatic transitions, data extensions, task definitions, and view configurations for testing complex long-polling scenarios.

Changes

Cohort / File(s) Summary
Grandchild Workflow Core
core/Workflows/subflow-test/subflow-view-test-grandchild.json
New grandchild workflow definition with four states (active, busy, after-busy, completed), data extension integration, and transitions. Includes nested busy-state handling and subflow mappings for multi-level orchestration.
Grandchild Mapping Scripts
core/Workflows/subflow-test/src/GrandchildStartMapping.csx, GrandchildCompleteMapping.csx, ChildToGrandchildSubFlowMapping.csx
Three new IMapping implementations handling grandchild initialization, completion, and parent-child transitions with detailed context building, error handling, and metadata propagation across nesting levels.
Busy Subprocess Workflow
core/Workflows/subflow-test/busy-subprocess-workflow.json
New workflow with processing → trigger → completed states, embedded CSX mappings, automatic transitions, and multilingual labels. Implements fire-and-forget subprocess pattern with parent triggering.
Busy Subprocess Mapping Scripts
core/Workflows/subflow-test/src/StartBusySubprocessMapping.csx, BusySubprocessStartMapping.csx, TriggerParentBusyCompletionMapping.csx
Three new IMapping implementations configuring subprocess launch, tracking subprocess start state, and triggering parent workflow completion with detailed logging and error handling.
Busy Subprocess Tasks
core/Tasks/subflow-test/start-busy-subprocess-task.json, trigger-busy-completion-task.json
New SubProcessTask and DirectTriggerTask definitions referencing busy-subprocess-workflow and completion transitions, scoped to sys-tasks and sys-flows domains.
Grandchild Data Extension
core/Extensions/subflow-test/grandchild-data-extension.json, core/Extensions/subflow-test/src/GrandchildDataExtensionMapping.csx
New data extension with IMapping implementation validating HTTP tasks, constructing JSON request bodies, and returning structured subflow test metadata with configuration hierarchy and timestamps.
Grandchild View
core/Views/subflow-test/grandchild-workflow-view.json
New form-based view with multilingual labels (en-US, tr-TR), three fields (status, nesting level, info), and complete action button for grandchild-level interaction.
Workflow Diagrams
core/Workflows/subflow-test/.meta/busy-subprocess-workflow.diagram.json, subflow-view-test-grandchild.diagram.json, subflow-view-test-parent.diagram.json, subflow-view-test-child.diagram.json
New and updated diagram metadata defining node positions and state transitions; busy-subprocess includes four states with auto-transitions; grandchild and parent diagrams added for visualization.
Child Workflow Updates
core/Workflows/subflow-test/subflow-view-test-child.json
Restructured to add grandchild subflow path with new waiting-for-grandchild state (subType 4), updated initial state naming (child-active → child-initial), and embedded ChildToGrandchildSubFlowMapping.
Test Documentation & Suite
core/Workflows/subflow-test/BUSY-STATE-TEST-README.md, core/Workflows/subflow-test/subflow-view-test.http
New documentation covering busy-state test objectives, API endpoints, and expected payloads; HTTP test suite expanded from 2-level to 3-level nested testing with busy-state subprocess and automatic transitions.
Error Boundary Updates
core/Workflows/task-test/error-boundary-test-workflow.json
Updated retry policy durations to ISO-8601 format (PT2S, PT5S, etc.) and corrected transition target references (error-recovery → recovery-to-rollback).
Version Updates
package.json, vnext.config.json
Bumped @burgan-tech/vnext-schema from ^0.0.28 to ^0.0.33 in package dependencies; updated vnext.config.json runtimeVersion to 0.0.32 and schemaVersion to 0.0.33.

Sequence Diagram(s)

sequenceDiagram
    participant Parent as Parent Workflow
    participant Child as Child Workflow
    participant Grandchild as Grandchild Workflow
    participant GCExt as Grandchild Extension
    participant Busy as Busy State
    participant Subprocess as Busy Subprocess
    participant DirectTrigger as DirectTriggerTask

    Parent->>Child: 1. Trigger child subflow (ChildToGrandchildSubFlowMapping)
    Child->>Grandchild: 2. Launch grandchild via subFlow
    GCExt->>Grandchild: 3. Inject data (GrandchildDataExtensionMapping)
    Grandchild->>Busy: 4. Enter busy state (StartBusySubprocessMapping)
    Busy->>Subprocess: 5. Launch independent subprocess (start-busy-subprocess-task)
    Subprocess->>Subprocess: 6. Execute processing with auto-transitions
    Subprocess->>DirectTrigger: 7. Signal completion (TriggerParentBusyCompletionMapping)
    DirectTrigger->>Grandchild: 8. Trigger parent to exit busy state
    Grandchild->>Grandchild: 9. Transition to after-busy then complete
    Grandchild->>Child: 10. Return completion result (GrandchildCompleteMapping)
    Child->>Parent: 11. Resume parent workflow
Loading
sequenceDiagram
    participant Client as Test Client
    participant Parent as Parent (Level 1)
    participant Child as Child (Level 2)
    participant Grandchild as Grandchild (Level 3)
    participant GCView as Grandchild View

    Client->>Parent: POST /start-parent
    Parent->>Child: Initialize child subflow (view: child-workflow-view)
    Child->>Grandchild: Initialize grandchild subflow (view: grandchild-workflow-view)
    Client->>GCView: GET grandchild state & data
    GCView-->>Client: Return 3-level nested context
    Client->>Grandchild: POST /trigger-grandchild-complete
    Grandchild-->>Child: Return completion with nestingLevel=3
    Child-->>Parent: Return child result with nestingLevel=2
    Parent-->>Client: Return parent final state with nestingLevel=1
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • middt

🐰 Hops excitedly through nested burrows

Three levels deep, the workflows dance,
With busy states in subprocess trance,
Grandchild data flows like morning dew,
Auto-transitions make dreams come true! ✨
Munches carrot while observing orchestration


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@yilmaztayfun yilmaztayfun merged commit 0be2ce7 into master Jan 26, 2026
2 of 4 checks passed
@gemini-code-assist
Copy link

Summary of Changes

Hello @yilmaztayfun, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a powerful new 'busy' state capability for workflows, enabling them to intelligently pause execution while an independent subprocess handles a task, then resume upon receiving a trigger from that subprocess. This feature is thoroughly demonstrated and tested using a complex, three-level nested subflow structure, ensuring robust functionality for managing asynchronous operations within deeply integrated workflows.

Highlights

  • New Busy State (subType: 5): Introduced a new 'Busy' state (subType: 5) for workflows, allowing a workflow to pause and wait for an external trigger, typically from an independent subprocess.
  • Deeply Nested Subflow Test: Implemented a comprehensive test scenario for a three-level nested subflow hierarchy (Parent > Child > Grandchild) to validate the new busy state functionality and long-polling views.
  • New Task Definitions: Added start-busy-subprocess-task (SubProcessTask) to launch independent subprocesses and trigger-busy-completion-task (DirectTriggerTask) to trigger transitions on parent workflows from subprocesses.
  • C# Mapping Scripts: Created several new C# mapping scripts (GrandchildDataExtensionMapping.csx, BusySubprocessStartMapping.csx, ChildToGrandchildSubFlowMapping.csx, GrandchildCompleteMapping.csx, GrandchildStartMapping.csx, StartBusySubprocessMapping.csx, TriggerParentBusyCompletionMapping.csx) to manage data flow, subprocess initiation, and state transitions within the nested workflows.
  • Updated HTTP Test Script: The subflow-view-test.http script was significantly expanded to include detailed steps for testing the 3-level nested subflows, including the new busy state behavior and subprocess triggering.
  • Schema and Runtime Version Updates: Updated @burgan-tech/vnext-schema dependency, runtimeVersion, and schemaVersion to support the new subType values and other platform enhancements.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The various mappings use parentInstanceId, childInstanceId, and grandchildInstanceId inconsistently (e.g. StartBusySubprocessMapping sets parentInstanceId from childInstanceId while TriggerParentBusyCompletionMapping reads parentInstanceId to target the grandchild); it would be safer to align these names and values to the actual hierarchy so the subprocess always targets the intended parent instance without relying on implicit overwrites.
  • GrandchildDataExtensionMapping.csx uses Dictionary<string, string?> but does not include using System.Collections.Generic;, which will prevent this script from compiling; add the missing using directive or fully qualify Dictionary.
  • Several mapping OutputHandler methods are marked async but never await anything, which adds unnecessary state machine overhead; consider removing the async keyword and returning Task.FromResult(...) where appropriate unless the interface requires a truly asynchronous implementation.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The various mappings use `parentInstanceId`, `childInstanceId`, and `grandchildInstanceId` inconsistently (e.g. `StartBusySubprocessMapping` sets `parentInstanceId` from `childInstanceId` while `TriggerParentBusyCompletionMapping` reads `parentInstanceId` to target the grandchild); it would be safer to align these names and values to the actual hierarchy so the subprocess always targets the intended parent instance without relying on implicit overwrites.
- `GrandchildDataExtensionMapping.csx` uses `Dictionary<string, string?>` but does not include `using System.Collections.Generic;`, which will prevent this script from compiling; add the missing using directive or fully qualify `Dictionary`.
- Several mapping `OutputHandler` methods are marked `async` but never `await` anything, which adds unnecessary state machine overhead; consider removing the `async` keyword and returning `Task.FromResult(...)` where appropriate unless the interface requires a truly asynchronous implementation.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request introduces a comprehensive test for deeply nested subflow workflows, specifically focusing on the new 'Busy' state (subType: 5). This involves adding new tasks, workflow definitions, C# mapping scripts, and updating existing test files. The changes are well-documented in the new BUSY-STATE-TEST-README.md. The update of the @burgan-tech/vnext-schema dependency addresses a known schema validation issue, which is a good resolution. Overall, the changes are well-structured and add significant testing coverage for a new feature.

}
}
}
} No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It's good practice to end JSON files with a newline character for better compatibility with various tools and version control systems.

  }
}

extensionType = "grandchild-data-extension",
instanceId = context.Instance?.Id,
workflowKey = context.Workflow?.Key,
parentInstanceId = context.Instance?.Data?.parentInstanceId,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

In the context of a grandchild workflow, context.Instance?.Data?.parentInstanceId would refer to the child workflow's instance ID. To avoid confusion, consider renaming this field to childInstanceId or parentOfGrandchildInstanceId to clearly indicate its role in the hierarchy.

                childInstanceId = context.Instance?.Data?.parentInstanceId,

instanceId = context.Instance?.Id,
workflowKey = context.Workflow?.Key,
parentInstanceId = context.Instance?.Data?.parentInstanceId,
childInstanceId = context.Instance?.Data?.childInstanceId,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

If context.Instance?.Data?.childInstanceId is intended to represent the grandchild's own instance ID, it might be clearer to use context.Instance?.Id directly or rename this field to grandchildInstanceId for better readability and to prevent confusion in a deeply nested context.

                grandchildInstanceId = context.Instance?.Data?.childInstanceId,

parentInstanceId = context.Instance?.Data?.parentInstanceId,
childInstanceId = context.Instance?.Data?.childInstanceId,
nestingLevel = 3,
requestedAt = DateTime.UtcNow

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The field name requestedAt might be misleading as this is an extension mapping, not a direct request. Consider renaming it to generatedAt or createdAt for better semantic clarity.

                generatedAt = DateTime.UtcNow

extensionName = "grandchild-data-extension",
source = "grandchild-workflow",
nestingLevel = 3,
loadedAt = DateTime.UtcNow,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to requestedAt, loadedAt might be better named generatedAt or createdAt for consistency and to reflect when the data was actually produced by the extension.

                        generatedAt = DateTime.UtcNow,

},
"mapping": {
"location": "./src/ChildToGrandchildSubFlowMapping.csx",
"code": "dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYzsKdXNpbmcgU3lzdGVtLkR5bmFtaWM7CnVzaW5nIFN5c3RlbS5UaHJlYWRpbmcuVGFza3M7CnVzaW5nIEJCVC5Xb3JrZmxvdy5EZWZpbml0aW9uczsKdXNpbmcgQkJULldvcmtmbG93LlNjcmlwdGluZzsKdXNpbmcgQkJULldvcmtmbG93LlNjcmlwdGluZy5GdW5jdGlvbnM7CgovLy8gPHN1bW1hcnk+Ci8vLyBDaGlsZCB0byBHcmFuZGNoaWxkIFN1YkZsb3cgTWFwcGluZyAtIEhhbmRsZXMgaW5wdXQvb3V0cHV0IGZvciBncmFuZGNoaWxkIHN1YmZsb3cgc3RhdGUKLy8vIFRoaXMgbWFwcGluZyBwcmVwYXJlcyBkYXRhIGZvciBncmFuZGNoaWxkIHN1YmZsb3cgYW5kIHByb2Nlc3NlcyBpdHMgcmVzdWx0LgovLy8gTWFuYWdlcyB0aGUgTGV2ZWwgMiB0byBMZXZlbCAzIHRyYW5zaXRpb24gaW4gdGhlIHN1YmZsb3cgaGllcmFyY2h5LgovLy8gPC9zdW1tYXJ5PgpwdWJsaWMgY2xhc3MgQ2hpbGRUb0dyYW5kY2hpbGRTdWJGbG93TWFwcGluZyA6IFNjcmlwdEJhc2UsIElTdWJGbG93TWFwcGluZwp7CiAgICAvLy8gPHN1bW1hcnk+CiAgICAvLy8gUHJlcGFyZXMgaW5wdXQgZGF0YSBmb3IgdGhlIGdyYW5kY2hpbGQgc3ViZmxvdwogICAgLy8vIDwvc3VtbWFyeT4KICAgIHB1YmxpYyBhc3luYyBUYXNrPFNjcmlwdFJlc3BvbnNlPiBJbnB1dEhhbmRsZXIoU2NyaXB0Q29udGV4dCBjb250ZXh0KQogICAgewogICAgICAgIHRyeQogICAgICAgIHsKICAgICAgICAgICAgTG9nSW5mb3JtYXRpb24oIkNoaWxkVG9HcmFuZGNoaWxkU3ViRmxvd01hcHBpbmcgLSBQcmVwYXJpbmcgZ3JhbmRjaGlsZCBzdWJmbG93IGlucHV0IGRhdGEiKTsKICAgICAgICAgICAgCiAgICAgICAgICAgIC8vIFByZXBhcmUgZGF0YSB0byBwYXNzIHRvIGdyYW5kY2hpbGQgd29ya2Zsb3cgdXNpbmcgRGljdGlvbmFyeQogICAgICAgICAgICB2YXIgdGVzdENvbnRleHQgPSBuZXcgRGljdGlvbmFyeTxzdHJpbmcsIG9iamVjdD4KICAgICAgICAgICAgewogICAgICAgICAgICAgICAgWyJ0ZXN0VHlwZSJdID0gImRlZXAtbmVzdGVkLXZpZXctZXh0ZW5zaW9uLWxvbmdwb2xsaW5nIiwKICAgICAgICAgICAgICAgIFsiZXhwZWN0Vmlld0RhdGEiXSA9IHRydWUsCiAgICAgICAgICAgICAgICBbImV4cGVjdEV4dGVuc2lvbkRhdGEiXSA9IHRydWUsCiAgICAgICAgICAgICAgICBbIm5lc3RpbmdMZXZlbCJdID0gMwogICAgICAgICAgICB9OwogICAgICAgICAgICAKICAgICAgICAgICAgdmFyIGlucHV0RGF0YSA9IG5ldyBEaWN0aW9uYXJ5PHN0cmluZywgb2JqZWN0PgogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBbImNoaWxkSW5zdGFuY2VJZCJdID0gY29udGV4dC5JbnN0YW5jZT8uSWQsCiAgICAgICAgICAgICAgICBbImNoaWxkV29ya2Zsb3dJZCJdID0gY29udGV4dC5Xb3JrZmxvdz8uS2V5ID8/IHN0cmluZy5FbXB0eSwKICAgICAgICAgICAgICAgIFsicGFyZW50SW5zdGFuY2VJZCJdID0gY29udGV4dC5JbnN0YW5jZT8uRGF0YT8ucGFyZW50SW5zdGFuY2VJZCwKICAgICAgICAgICAgICAgIFsicGFyZW50V29ya2Zsb3dJZCJdID0gY29udGV4dC5JbnN0YW5jZT8uRGF0YT8ucGFyZW50V29ya2Zsb3dJZCwKICAgICAgICAgICAgICAgIFsiaW5pdGlhdGVkQXQiXSA9IERhdGVUaW1lLlV0Y05vdywKICAgICAgICAgICAgICAgIFsiaW5pdGlhdGVkQnkiXSA9ICJjaGlsZC13b3JrZmxvdyIsCiAgICAgICAgICAgICAgICBbIm5lc3RpbmdMZXZlbCJdID0gMywKICAgICAgICAgICAgICAgIFsidGVzdENvbnRleHQiXSA9IHRlc3RDb250ZXh0CiAgICAgICAgICAgIH07CiAgICAgICAgICAgIAogICAgICAgICAgICByZXR1cm4gbmV3IFNjcmlwdFJlc3BvbnNlCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIEtleSA9IGNvbnRleHQuSW5zdGFuY2U/LktleSwKICAgICAgICAgICAgICAgIERhdGEgPSBpbnB1dERhdGEsCiAgICAgICAgICAgICAgICBUYWdzID0gbmV3W10geyAic3ViZmxvdy10ZXN0IiwgImdyYW5kY2hpbGQtc3ViZmxvdy1pbnB1dCIsICJsZXZlbC0zIiB9CiAgICAgICAgICAgIH07CiAgICAgICAgfQogICAgICAgIGNhdGNoIChFeGNlcHRpb24gZXgpCiAgICAgICAgewogICAgICAgICAgICBMb2dFcnJvcigiQ2hpbGRUb0dyYW5kY2hpbGRTdWJGbG93TWFwcGluZyBJbnB1dEhhbmRsZXIgLSBFcnJvcjogezB9IiwgYXJnczogbmV3IG9iamVjdD9bXSB7IGV4Lk1lc3NhZ2UgfSk7CiAgICAgICAgICAgIHJldHVybiBuZXcgU2NyaXB0UmVzcG9uc2UKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgS2V5ID0gImdyYW5kY2hpbGQtc3ViZmxvdy1pbnB1dC1lcnJvciIsCiAgICAgICAgICAgICAgICBEYXRhID0gbmV3IERpY3Rpb25hcnk8c3RyaW5nLCBvYmplY3Q+IHsgWyJlcnJvciJdID0gZXguTWVzc2FnZSB9CiAgICAgICAgICAgIH07CiAgICAgICAgfQogICAgfQoKICAgIC8vLyA8c3VtbWFyeT4KICAgIC8vLyBQcm9jZXNzZXMgdGhlIHJlc3VsdCBmcm9tIHRoZSBjb21wbGV0ZWQgZ3JhbmRjaGlsZCBzdWJmbG93CiAgICAvLy8gPC9zdW1tYXJ5PgogICAgcHVibGljIGFzeW5jIFRhc2s8U2NyaXB0UmVzcG9uc2U+IE91dHB1dEhhbmRsZXIoU2NyaXB0Q29udGV4dCBjb250ZXh0KQogICAgewogICAgICAgIHRyeQogICAgICAgIHsKICAgICAgICAgICAgTG9nSW5mb3JtYXRpb24oIkNoaWxkVG9HcmFuZGNoaWxkU3ViRmxvd01hcHBpbmcgLSBQcm9jZXNzaW5nIGdyYW5kY2hpbGQgc3ViZmxvdyBvdXRwdXQgZGF0YSIpOwogICAgICAgICAgICAKICAgICAgICAgICAgLy8gR2V0IGdyYW5kY2hpbGQgc3ViZmxvdyByZXN1bHQgZGF0YQogICAgICAgICAgICB2YXIgZ3JhbmRjaGlsZFJlc3VsdCA9IGNvbnRleHQuQm9keTsKICAgICAgICAgICAgCiAgICAgICAgICAgIHZhciBncmFuZGNoaWxkUmVzdWx0RGF0YSA9IG5ldyBEaWN0aW9uYXJ5PHN0cmluZywgb2JqZWN0PgogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBbImdyYW5kY2hpbGRJbnN0YW5jZURhdGEiXSA9IGdyYW5kY2hpbGRSZXN1bHQsCiAgICAgICAgICAgICAgICBbInByb2Nlc3NlZCJdID0gdHJ1ZSwKICAgICAgICAgICAgICAgIFsidmlld1Rlc3RSZXN1bHQiXSA9ICJzdWNjZXNzIiwKICAgICAgICAgICAgICAgIFsiZXh0ZW5zaW9uVGVzdFJlc3VsdCJdID0gInN1Y2Nlc3MiLAogICAgICAgICAgICAgICAgWyJkZWVwTmVzdGVkVGVzdFJlc3VsdCJdID0gInN1Y2Nlc3MiCiAgICAgICAgICAgIH07CiAgICAgICAgICAgIAogICAgICAgICAgICB2YXIgY2hpbGRDb250aW51YXRpb24gPSBuZXcgRGljdGlvbmFyeTxzdHJpbmcsIG9iamVjdD4KICAgICAgICAgICAgewogICAgICAgICAgICAgICAgWyJjYW5Qcm9jZWVkIl0gPSB0cnVlLAogICAgICAgICAgICAgICAgWyJuZXh0U3RhdGUiXSA9ICJjaGlsZC1hZnRlci1ncmFuZGNoaWxkIgogICAgICAgICAgICB9OwogICAgICAgICAgICAKICAgICAgICAgICAgdmFyIG91dHB1dERhdGEgPSBuZXcgRGljdGlvbmFyeTxzdHJpbmcsIG9iamVjdD4KICAgICAgICAgICAgewogICAgICAgICAgICAgICAgWyJncmFuZGNoaWxkU3ViZmxvd0NvbXBsZXRlZCJdID0gdHJ1ZSwKICAgICAgICAgICAgICAgIFsiY29tcGxldGVkQXQiXSA9IERhdGVUaW1lLlV0Y05vdywKICAgICAgICAgICAgICAgIFsiZ3JhbmRjaGlsZFJlc3VsdCJdID0gZ3JhbmRjaGlsZFJlc3VsdERhdGEsCiAgICAgICAgICAgICAgICBbImNoaWxkQ29udGludWF0aW9uIl0gPSBjaGlsZENvbnRpbnVhdGlvbiwKICAgICAgICAgICAgICAgIFsibmVzdGluZ0xldmVsIl0gPSAzCiAgICAgICAgICAgIH07CiAgICAgICAgICAgIAogICAgICAgICAgICByZXR1cm4gbmV3IFNjcmlwdFJlc3BvbnNlCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIEtleSA9ICJncmFuZGNoaWxkLXN1YmZsb3ctb3V0cHV0LXByb2Nlc3NlZCIsCiAgICAgICAgICAgICAgICBEYXRhID0gb3V0cHV0RGF0YSwKICAgICAgICAgICAgICAgIFRhZ3MgPSBuZXdbXSB7ICJzdWJmbG93LXRlc3QiLCAiZ3JhbmRjaGlsZC1zdWJmbG93LW91dHB1dCIsICJjb21wbGV0ZWQiLCAibGV2ZWwtMyIgfQogICAgICAgICAgICB9OwogICAgICAgIH0KICAgICAgICBjYXRjaCAoRXhjZXB0aW9uIGV4KQogICAgICAgIHsKICAgICAgICAgICAgTG9nRXJyb3IoIkNoaWxkVG9HcmFuZGNoaWxkU3ViRmxvd01hcHBpbmcgT3V0cHV0SGFuZGxlciAtIEVycm9yOiB7MH0iLCBhcmdzOiBuZXcgb2JqZWN0P1tdIHsgZXguTWVzc2FnZSB9KTsKICAgICAgICAgICAgcmV0dXJuIG5ldyBTY3JpcHRSZXNwb25zZQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBLZXkgPSAiZ3JhbmRjaGlsZC1zdWJmbG93LW91dHB1dC1lcnJvciIsCiAgICAgICAgICAgICAgICBEYXRhID0gbmV3IERpY3Rpb25hcnk8c3RyaW5nLCBvYmplY3Q+IHsgWyJlcnJvciJdID0gZXguTWVzc2FnZSB9CiAgICAgICAgICAgIH07CiAgICAgICAgfQogICAgfQp9Cg=="

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Embedding base64 encoded C# code directly in the JSON makes the workflow definition harder to read and maintain. While a location is provided, it's generally preferable to rely solely on the location field and keep the C# code in its dedicated .csx file. This improves separation of concerns and makes the JSON cleaner.

},
"mapping": {
"location": "./src/GrandchildStartMapping.csx",
"code": "dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uVGhyZWFkaW5nLlRhc2tzOwp1c2luZyBCQlQuV29ya2Zsb3cuRGVmaW5pdGlvbnM7CnVzaW5nIEJCVC5Xb3JrZmxvdy5TY3JpcHRpbmc7CnVzaW5nIEJCVC5Xb3JrZmxvdy5TY3JpcHRpbmcuRnVuY3Rpb25zOwoKLy8vIDxzdW1tYXJ5PgovLy8gR3JhbmRjaGlsZCBTdGFydCBNYXBwaW5nIC0gSW5pdGlhbGl6ZXMgdGhlIGdyYW5kY2hpbGQgd29ya2Zsb3cgd2l0aCBkYXRhIGZyb20gY2hpbGQKLy8vIFRoaXMgaXMgdGhlIGRlZXBlc3QgbGV2ZWwgKGxldmVsIDMpIGluIHRoZSBzdWJmbG93IGhpZXJhcmNoeS4KLy8vIDwvc3VtbWFyeT4KcHVibGljIGNsYXNzIEdyYW5kY2hpbGRTdGFydE1hcHBpbmcgOiBTY3JpcHRCYXNlLCBJTWFwcGluZwp7CiAgICBwdWJsaWMgVGFzazxTY3JpcHRSZXNwb25zZT4gSW5wdXRIYW5kbGVyKFdvcmtmbG93VGFzayB0YXNrLCBTY3JpcHRDb250ZXh0IGNvbnRleHQpCiAgICB7CiAgICAgICAgcmV0dXJuIFRhc2suRnJvbVJlc3VsdChuZXcgU2NyaXB0UmVzcG9uc2UoKSk7CiAgICB9CgogICAgcHVibGljIGFzeW5jIFRhc2s8U2NyaXB0UmVzcG9uc2U+IE91dHB1dEhhbmRsZXIoU2NyaXB0Q29udGV4dCBjb250ZXh0KQogICAgewogICAgICAgIHRyeQogICAgICAgIHsKICAgICAgICAgICAgTG9nSW5mb3JtYXRpb24oIkdyYW5kY2hpbGRTdGFydE1hcHBpbmcgLSBJbml0aWFsaXppbmcgZ3JhbmRjaGlsZCB3b3JrZmxvdyAoTGV2ZWwgMykiKTsKICAgICAgICAgICAgCiAgICAgICAgICAgIHZhciBpbnB1dERhdGEgPSBjb250ZXh0Lkluc3RhbmNlPy5EYXRhOwogICAgICAgICAgICAKICAgICAgICAgICAgcmV0dXJuIG5ldyBTY3JpcHRSZXNwb25zZQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBLZXkgPSAiZ3JhbmRjaGlsZC1zdGFydC1zdWNjZXNzIiwKICAgICAgICAgICAgICAgIERhdGEgPSBuZXcKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICBncmFuZGNoaWxkV29ya2Zsb3dJZCA9IGNvbnRleHQuV29ya2Zsb3c/LktleSwKICAgICAgICAgICAgICAgICAgICBncmFuZGNoaWxkSW5zdGFuY2VJZCA9IGNvbnRleHQuSW5zdGFuY2U/LklkLAogICAgICAgICAgICAgICAgICAgIGNoaWxkSW5zdGFuY2VJZCA9IGlucHV0RGF0YT8uY2hpbGRJbnN0YW5jZUlkLAogICAgICAgICAgICAgICAgICAgIGNoaWxkV29ya2Zsb3dJZCA9IGlucHV0RGF0YT8uY2hpbGRXb3JrZmxvd0lkLAogICAgICAgICAgICAgICAgICAgIHBhcmVudEluc3RhbmNlSWQgPSBpbnB1dERhdGE/LnBhcmVudEluc3RhbmNlSWQsCiAgICAgICAgICAgICAgICAgICAgcGFyZW50V29ya2Zsb3dJZCA9IGlucHV0RGF0YT8ucGFyZW50V29ya2Zsb3dJZCwKICAgICAgICAgICAgICAgICAgICBuZXN0aW5nTGV2ZWwgPSAzLAogICAgICAgICAgICAgICAgICAgIHN0YXJ0ZWRBdCA9IERhdGVUaW1lLlV0Y05vdywKICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSAiYWN0aXZlIiwKICAgICAgICAgICAgICAgICAgICBtZXNzYWdlID0gIkdyYW5kY2hpbGQgd29ya2Zsb3cgc3RhcnRlZCBzdWNjZXNzZnVsbHkgKExldmVsIDMpIiwKICAgICAgICAgICAgICAgICAgICBncmFuZGNoaWxkQ29udGV4dCA9IG5ldwogICAgICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAgICAgaXNTdWJmbG93ID0gdHJ1ZSwKICAgICAgICAgICAgICAgICAgICAgICAgaXNEZWVwTmVzdGVkID0gdHJ1ZSwKICAgICAgICAgICAgICAgICAgICAgICAgYmxvY2tzUGFyZW50ID0gdHJ1ZSwKICAgICAgICAgICAgICAgICAgICAgICAgdmlld1Rlc3RFbmFibGVkID0gdHJ1ZSwKICAgICAgICAgICAgICAgICAgICAgICAgZXh0ZW5zaW9uVGVzdEVuYWJsZWQgPSB0cnVlLAogICAgICAgICAgICAgICAgICAgICAgICBoaWVyYXJjaHlQYXRoID0gIlBhcmVudCA+IENoaWxkID4gR3JhbmRjaGlsZCIKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgVGFncyA9IG5ld1tdIHsgInN1YmZsb3ctdGVzdCIsICJncmFuZGNoaWxkLXdvcmtmbG93IiwgInN0YXJ0ZWQiLCAibGV2ZWwtMyIgfQogICAgICAgICAgICB9OwogICAgICAgIH0KICAgICAgICBjYXRjaCAoRXhjZXB0aW9uIGV4KQogICAgICAgIHsKICAgICAgICAgICAgTG9nRXJyb3IoIkdyYW5kY2hpbGRTdGFydE1hcHBpbmcgLSBFcnJvcjogezB9IiwgYXJnczogbmV3IG9iamVjdD9bXSB7IGV4Lk1lc3NhZ2UgfSk7CiAgICAgICAgICAgIHJldHVybiBuZXcgU2NyaXB0UmVzcG9uc2UKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgS2V5ID0gImdyYW5kY2hpbGQtc3RhcnQtZXJyb3IiLAogICAgICAgICAgICAgICAgRGF0YSA9IG5ldyB7IGVycm9yID0gZXguTWVzc2FnZSB9CiAgICAgICAgICAgIH07CiAgICAgICAgfQogICAgfQp9Cg=="

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Embedding base64 encoded C# code directly in the JSON makes the workflow definition harder to read and maintain. While a location is provided, it's generally preferable to rely solely on the location field and keep the C# code in its dedicated .csx file. This improves separation of concerns and makes the JSON cleaner.

},
"mapping": {
"location": "./src/StartBusySubprocessMapping.csx",
"code": "dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uVGhyZWFkaW5nLlRhc2tzOwp1c2luZyBCQlQuV29ya2Zsb3cuRGVmaW5pdGlvbnM7CnVzaW5nIEJCVC5Xb3JrZmxvdy5TY3JpcHRpbmc7CnVzaW5nIEJCVC5Xb3JrZmxvdy5TY3JpcHRpbmcuRnVuY3Rpb25zOwoKLy8vIDxzdW1tYXJ5PgovLy8gU3RhcnQgQnVzeSBTdWJQcm9jZXNzIE1hcHBpbmcgLSBTdGFydHMgdGhlIHN1YnByb2Nlc3Mgd2hlbiBncmFuZGNoaWxkIGVudGVycyBidXN5IHN0YXRlCi8vLyBUaGlzIG1hcHBpbmcgY29uZmlndXJlcyB0aGUgU3ViUHJvY2Vzc1Rhc2sgdG8gbGF1bmNoIGFuIGluZGVwZW5kZW50IHN1YnByb2Nlc3MKLy8vIDwvc3VtbWFyeT4KcHVibGljIGNsYXNzIFN0YXJ0QnVzeVN1YnByb2Nlc3NNYXBwaW5nIDogU2NyaXB0QmFzZSwgSU1hcHBpbmcKewogICAgcHVibGljIFRhc2s8U2NyaXB0UmVzcG9uc2U+IElucHV0SGFuZGxlcihXb3JrZmxvd1Rhc2sgdGFzaywgU2NyaXB0Q29udGV4dCBjb250ZXh0KQogICAgewogICAgICAgIHRyeQogICAgICAgIHsKICAgICAgICAgICAgdmFyIHN1YlByb2Nlc3NUYXNrID0gdGFzayBhcyBTdWJQcm9jZXNzVGFzazsKICAgICAgICAgICAgCiAgICAgICAgICAgIExvZ0luZm9ybWF0aW9uKCJTdGFydEJ1c3lTdWJwcm9jZXNzTWFwcGluZyAtIFByZXBhcmluZyB0byBzdGFydCBidXN5IHN1YnByb2Nlc3MiKTsKICAgICAgICAgICAgCiAgICAgICAgICAgIC8vIENvbmZpZ3VyZSBzdWJwcm9jZXNzCiAgICAgICAgICAgIHN1YlByb2Nlc3NUYXNrLlNldERvbWFpbigiY29yZSIpOwogICAgICAgICAgICBzdWJQcm9jZXNzVGFzay5TZXRGbG93KCJzeXMtZmxvd3MiKTsKICAgICAgICAgICAgc3ViUHJvY2Vzc1Rhc2suU2V0S2V5KCJidXN5LXN1YnByb2Nlc3Mtd29ya2Zsb3ciKTsKICAgICAgICAgICAgCiAgICAgICAgICAgIC8vIFByZXBhcmUgc3VicHJvY2VzcyBkYXRhIC0gaW5jbHVkZSBwYXJlbnQgaW5zdGFuY2UgSUQgc28gc3VicHJvY2VzcyBjYW4gdHJpZ2dlciBiYWNrCiAgICAgICAgICAgIHN1YlByb2Nlc3NUYXNrLlNldEJvZHkobmV3CiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGdyYW5kY2hpbGRJbnN0YW5jZUlkID0gY29udGV4dC5JbnN0YW5jZT8uSWQsCiAgICAgICAgICAgICAgICBncmFuZGNoaWxkV29ya2Zsb3dJZCA9IGNvbnRleHQuV29ya2Zsb3c/LktleSwKICAgICAgICAgICAgICAgIHBhcmVudEluc3RhbmNlSWQgPSBjb250ZXh0Lkluc3RhbmNlPy5EYXRhPy5jaGlsZEluc3RhbmNlSWQsCiAgICAgICAgICAgICAgICBzdGFydGVkQXQgPSBEYXRlVGltZS5VdGNOb3csCiAgICAgICAgICAgICAgICB0YXNrVHlwZSA9ICJidXN5LXN0YXRlLXByb2Nlc3NpbmciLAogICAgICAgICAgICAgICAgY29udGV4dCA9IG5ldwogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgIG5lc3RpbmdMZXZlbCA9IDMsCiAgICAgICAgICAgICAgICAgICAgdGVzdFR5cGUgPSAiYnVzeS1zdGF0ZS10ZXN0IiwKICAgICAgICAgICAgICAgICAgICBleHBlY3RlZEJlaGF2aW9yID0gInN1YnByb2Nlc3Mtd2lsbC10cmlnZ2VyLXBhcmVudCIKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIAogICAgICAgICAgICBMb2dJbmZvcm1hdGlvbigiU3RhcnRCdXN5U3VicHJvY2Vzc01hcHBpbmcgLSBTdWJwcm9jZXNzIGNvbmZpZ3VyZWQgYW5kIHJlYWR5IHRvIGxhdW5jaCIpOwogICAgICAgICAgICAKICAgICAgICAgICAgcmV0dXJuIFRhc2suRnJvbVJlc3VsdChuZXcgU2NyaXB0UmVzcG9uc2UKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgRGF0YSA9IGNvbnRleHQuSW5zdGFuY2U/LkRhdGEKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICAgIGNhdGNoIChFeGNlcHRpb24gZXgpCiAgICAgICAgewogICAgICAgICAgICBMb2dFcnJvcigiU3RhcnRCdXN5U3VicHJvY2Vzc01hcHBpbmcgLSBFcnJvcjogezB9IiwgYXJnczogbmV3IG9iamVjdD9bXSB7IGV4Lk1lc3NhZ2UgfSk7CiAgICAgICAgICAgIHJldHVybiBUYXNrLkZyb21SZXN1bHQobmV3IFNjcmlwdFJlc3BvbnNlCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIEtleSA9ICJzdWJwcm9jZXNzLXN0YXJ0LWVycm9yIiwKICAgICAgICAgICAgICAgIERhdGEgPSBuZXcgeyBlcnJvciA9IGV4Lk1lc3NhZ2UgfQogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICB9CgogICAgcHVibGljIGFzeW5jIFRhc2s8U2NyaXB0UmVzcG9uc2U+IE91dHB1dEhhbmRsZXIoU2NyaXB0Q29udGV4dCBjb250ZXh0KQogICAgewogICAgICAgIHRyeQogICAgICAgIHsKICAgICAgICAgICAgTG9nSW5mb3JtYXRpb24oIlN0YXJ0QnVzeVN1YnByb2Nlc3NNYXBwaW5nIC0gU3VicHJvY2VzcyBsYXVuY2hlZCBzdWNjZXNzZnVsbHkiKTsKICAgICAgICAgICAgCiAgICAgICAgICAgIC8vIFN1YlByb2Nlc3MgaXMgZmlyZS1hbmQtZm9yZ2V0LCBqdXN0IHRyYWNrIHRoYXQgaXQgd2FzIGluaXRpYXRlZAogICAgICAgICAgICByZXR1cm4gbmV3IFNjcmlwdFJlc3BvbnNlCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIERhdGEgPSBuZXcKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICBzdWJwcm9jZXNzTGF1bmNoZWQgPSB0cnVlLAogICAgICAgICAgICAgICAgICAgIHN1YnByb2Nlc3NJbnN0YW5jZUlkID0gY29udGV4dC5Cb2R5Py5kYXRhPy5pbnN0YW5jZUlkLAogICAgICAgICAgICAgICAgICAgIGxhdW5jaGVkQXQgPSBEYXRlVGltZS5VdGNOb3csCiAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gIkJVU1kiLAogICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgPSAiU3VicHJvY2VzcyBsYXVuY2hlZCAtIGdyYW5kY2hpbGQgbm93IGluIGJ1c3kgc3RhdGUgd2FpdGluZyBmb3Igc3VicHJvY2VzcyB0byBjb21wbGV0ZSIKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfTsKICAgICAgICB9CiAgICAgICAgY2F0Y2ggKEV4Y2VwdGlvbiBleCkKICAgICAgICB7CiAgICAgICAgICAgIExvZ0Vycm9yKCJTdGFydEJ1c3lTdWJwcm9jZXNzTWFwcGluZyAtIE91dHB1dCBoYW5kbGVyIGVycm9yOiB7MH0iLCBhcmdzOiBuZXcgb2JqZWN0P1tdIHsgZXguTWVzc2FnZSB9KTsKICAgICAgICAgICAgcmV0dXJuIG5ldyBTY3JpcHRSZXNwb25zZQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBLZXkgPSAib3V0cHV0LWVycm9yIiwKICAgICAgICAgICAgICAgIERhdGEgPSBuZXcgeyBlcnJvciA9IGV4Lk1lc3NhZ2UgfQogICAgICAgICAgICB9OwogICAgICAgIH0KICAgIH0KfQo="

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Embedding base64 encoded C# code directly in the JSON makes the workflow definition harder to read and maintain. While a location is provided, it's generally preferable to rely solely on the location field and keep the C# code in its dedicated .csx file. This improves separation of concerns and makes the JSON cleaner.

},
"mapping": {
"location": "./src/GrandchildCompleteMapping.csx",
"code": "dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uVGhyZWFkaW5nLlRhc2tzOwp1c2luZyBCQlQuV29ya2Zsb3cuRGVmaW5pdGlvbnM7CnVzaW5nIEJCVC5Xb3JrZmxvdy5TY3JpcHRpbmc7CnVzaW5nIEJCVC5Xb3JrZmxvdy5TY3JpcHRpbmcuRnVuY3Rpb25zOwoKLy8vIDxzdW1tYXJ5PgovLy8gR3JhbmRjaGlsZCBDb21wbGV0ZSBNYXBwaW5nIC0gTWFya3MgdGhlIGdyYW5kY2hpbGQgd29ya2Zsb3cgYXMgY29tcGxldGVkCi8vLyBUaGlzIGRhdGEgd2lsbCBiZSByZXR1cm5lZCB0byB0aGUgY2hpbGQgd29ya2Zsb3cgKExldmVsIDIpCi8vLyA8L3N1bW1hcnk+CnB1YmxpYyBjbGFzcyBHcmFuZGNoaWxkQ29tcGxldGVNYXBwaW5nIDogU2NyaXB0QmFzZSwgSU1hcHBpbmcKewogICAgcHVibGljIFRhc2s8U2NyaXB0UmVzcG9uc2U+IElucHV0SGFuZGxlcihXb3JrZmxvd1Rhc2sgdGFzaywgU2NyaXB0Q29udGV4dCBjb250ZXh0KQogICAgewogICAgICAgIHJldHVybiBUYXNrLkZyb21SZXN1bHQobmV3IFNjcmlwdFJlc3BvbnNlKCkpOwogICAgfQoKICAgIHB1YmxpYyBhc3luYyBUYXNrPFNjcmlwdFJlc3BvbnNlPiBPdXRwdXRIYW5kbGVyKFNjcmlwdENvbnRleHQgY29udGV4dCkKICAgIHsKICAgICAgICB0cnkKICAgICAgICB7CiAgICAgICAgICAgIExvZ0luZm9ybWF0aW9uKCJHcmFuZGNoaWxkQ29tcGxldGVNYXBwaW5nIC0gQ29tcGxldGluZyBncmFuZGNoaWxkIHdvcmtmbG93IChMZXZlbCAzKSIpOwogICAgICAgICAgICAKICAgICAgICAgICAgdmFyIGlucHV0RGF0YSA9IGNvbnRleHQuSW5zdGFuY2U/LkRhdGE7CiAgICAgICAgICAgIAogICAgICAgICAgICByZXR1cm4gbmV3IFNjcmlwdFJlc3BvbnNlCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIEtleSA9ICJncmFuZGNoaWxkLWNvbXBsZXRlLXN1Y2Nlc3MiLAogICAgICAgICAgICAgICAgRGF0YSA9IG5ldwogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgIGNvbXBsZXRlZEF0ID0gRGF0ZVRpbWUuVXRjTm93LAogICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9ICJjb21wbGV0ZWQiLAogICAgICAgICAgICAgICAgICAgIG5lc3RpbmdMZXZlbCA9IDMsCiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gbmV3CiAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAgICBncmFuZGNoaWxkV29ya2Zsb3dJZCA9IGNvbnRleHQuV29ya2Zsb3c/LktleSwKICAgICAgICAgICAgICAgICAgICAgICAgZ3JhbmRjaGlsZEluc3RhbmNlSWQgPSBjb250ZXh0Lkluc3RhbmNlPy5JZCwKICAgICAgICAgICAgICAgICAgICAgICAgc3VjY2VzcyA9IHRydWUsCiAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgPSAiR3JhbmRjaGlsZCB3b3JrZmxvdyBjb21wbGV0ZWQgc3VjY2Vzc2Z1bGx5IChMZXZlbCAzKSIsCiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFGb3JDaGlsZCA9IG5ldwogICAgICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBncmFuZGNoaWxkUmVzdWx0ID0gInByb2Nlc3NlZCIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9jZXNzaW5nVGltZSA9IDEwMCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZXdUZXN0UGFzc2VkID0gdHJ1ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dGVuc2lvblRlc3RQYXNzZWQgPSB0cnVlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVlcE5lc3RlZFRlc3RQYXNzZWQgPSB0cnVlCiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgVGFncyA9IG5ld1tdIHsgInN1YmZsb3ctdGVzdCIsICJncmFuZGNoaWxkLXdvcmtmbG93IiwgImNvbXBsZXRlZCIsICJsZXZlbC0zIiB9CiAgICAgICAgICAgIH07CiAgICAgICAgfQogICAgICAgIGNhdGNoIChFeGNlcHRpb24gZXgpCiAgICAgICAgewogICAgICAgICAgICBMb2dFcnJvcigiR3JhbmRjaGlsZENvbXBsZXRlTWFwcGluZyAtIEVycm9yOiB7MH0iLCBhcmdzOiBuZXcgb2JqZWN0P1tdIHsgZXguTWVzc2FnZSB9KTsKICAgICAgICAgICAgcmV0dXJuIG5ldyBTY3JpcHRSZXNwb25zZQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBLZXkgPSAiZ3JhbmRjaGlsZC1jb21wbGV0ZS1lcnJvciIsCiAgICAgICAgICAgICAgICBEYXRhID0gbmV3IHsgZXJyb3IgPSBleC5NZXNzYWdlIH0KICAgICAgICAgICAgfTsKICAgICAgICB9CiAgICB9Cn0K"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Embedding base64 encoded C# code directly in the JSON makes the workflow definition harder to read and maintain. While a location is provided, it's generally preferable to rely solely on the location field and keep the C# code in its dedicated .csx file. This improves separation of concerns and makes the JSON cleaner.

}
]
}
} No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It's good practice to end JSON files with a newline character for better compatibility with various tools and version control systems.

    ]
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants