Skip to content

feat: support full user targeting on workflow USER TASK (fixes #169)#251

Merged
ako merged 7 commits intomainfrom
fix/171-workflow-user-targeting-rebased
Apr 22, 2026
Merged

feat: support full user targeting on workflow USER TASK (fixes #169)#251
ako merged 7 commits intomainfrom
fix/171-workflow-user-targeting-rebased

Conversation

@ako
Copy link
Copy Markdown
Collaborator

@ako ako commented Apr 22, 2026

Summary

  • Rebased PR feat: support full user targeting on workflow USER TASK #171 (originally by @engalar / wengoa liu) onto main after contributor could not address merge conflicts
  • Added TARGETING [USERS|GROUPS] MICROFLOW and TARGETING [USERS|GROUPS] XPATH syntax to user task activities in CREATE WORKFLOW and ALTER WORKFLOW SET ACTIVITY
  • Adds MicroflowGroupSource and XPathGroupSource types alongside the existing user-targeting variants
  • VoidConditionOutcome now generated before the parameter binding check (fixes CE6686 when no outcomes are specified)

Conflict resolution notes

All conflicts were in ANTLR-generated parser files — resolved by regenerating from the merged .g4 sources via make grammar. Two additional content conflicts in cmd_workflows.go and MDL_QUICK_REFERENCE.md were resolved by keeping main's lowercase syntax convention while adopting the PR's [USERS|GROUPS] targeting syntax.

Closes #171

Test plan

  • make build && make test && make lint all pass
  • workflow-user-targeting.mdl example script in mdl-examples/doctype-tests/ executes correctly
  • Validate with mx check in Studio Pro (integration test)

🤖 Generated with Claude Code

ako and others added 7 commits April 21, 2026 15:01
Incorporates all corrections from PR #214 (tinaengel-mx):
- Fix BSON field name: CustomDocumentType → DocumentType
- Clarify Excluded field: user-controllable toggle, not pre-release artifact
- Model type field: "" → "Text generation"
- Model metadata: decoded from key, not Portal-pushed on Test Key click
- KnowledgeBase key: update sample UUID/qualifiedName (LLMKey → KnowledbaseKey)
- ConsumedMCPService: add endpoint (String constant ref) and
  authenticationMicroflow (optional, no params, returns List<HttpHeader>)
- Agent: add microflow tool example (toolType: "Microflow", document ref)
- Agent: add minSimilarity to KB tool, temperature/topP/toolChoiceToolName fields
- UsageType: Conversational → Chat throughout
- Block keyword: MCP SERVICE → CONSUMED MCP SERVICE throughout
- Go structs: add ToolChoiceToolName, MinSimilarity, Endpoint,
  AuthenticationMicroflow; remove speculative Microflow field from ToolRef
- Catalog: add endpoint_constant, authentication_microflow columns
- Open Question #2 marked answered (microflow tool shape confirmed)
- Risk table: microflow tool shape row resolved

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Parser now reads both legacy UserSource and current UserTargeting BSON
fields, recognizing all five $Type variants: MicroflowUserTargeting,
XPathUserTargeting, MicroflowGroupTargeting, XPathGroupTargeting, and
NoUserTargeting. MDL syntax extended with optional USERS/GROUPS modifier:
TARGETING [USERS|GROUPS] MICROFLOW/XPATH.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- DESCRIBE output now emits explicit TARGETING USERS for user targeting
  types (symmetry with TARGETING GROUPS)
- Add version history comment for UserSource vs UserTargeting field names
- Add explicit NoUserSource/NoUserTargeting case in parseUserSource
- Swap XPathConstraint/XPath priority to match writer output
- Add doctype-test for all targeting variants
- Update quick reference with GROUPS modifier

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…6686)

autoBindCallMicroflow() generated the default VoidConditionOutcome
inside the microflow lookup loop, after the early return for explicit
parameter mappings. When MDL included WITH (...) clauses, the function
returned before reaching outcome generation, producing CallMicroflowTask
activities with empty Outcomes — triggering CE6686 in Studio Pro.

Move outcome generation before the parameter check so it runs
unconditionally.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ako ako merged commit b04c62e into main Apr 22, 2026
4 of 6 checks passed
@github-actions
Copy link
Copy Markdown

AI Code Review

Critical Issues

None found.

Moderate Issues

  • Scope violation: The PR addresses two unrelated concerns:

    1. Adding TARGETING [USERS|GROUPS] syntax for workflow user tasks (feature)
    2. Fixing VoidConditionOutcome generation order (bug fix for CE6686)

    According to the checklist: "Each PR should be scoped to a single feature or concern — flag if description needs 'and' between unrelated items". The PR description implicitly combines these with "and" (feature work and bug fix). These should be split into separate PRs.

Minor Issues

None found.

What Looks Good

  • MDL syntax design:
    • Uses standard CRUD verbs (CREATE WORKFLOW, ALTER WORKFLOW SET ACTIVITY)
    • Reads as English: user task ... targeting users microflow ... and user task ... targeting groups xpath ... are clear to business analysts
    • Uses qualified names (`Mod.MF

Automated review via OpenRouter (Nemotron Super 120B) — workflow source

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