-
Notifications
You must be signed in to change notification settings - Fork 60
feat(api-workflow): teach connector-event triggers #3437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rares-baesu-uipath
wants to merge
5
commits into
main
Choose a base branch
from
docs/api-workflow-triggers
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
08e5fad
docs(api-workflow): use a placeholder for the example email recipient
rares-baesu-uipath 502e916
feat(api-workflow): teach connector-event triggers
rares-baesu-uipath b20a578
docs(api-workflow): slim the trigger guide and fix Studio Web debug c…
rares-baesu-uipath 3ef9af2
docs(api-workflow): keep the bindings sync instruction out of the Stu…
rares-baesu-uipath bf228c3
docs(api-workflow): trim the trigger guide to what an agent acts on
rares-baesu-uipath File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
skill-flavors/studioweb/uipath-api-workflow/references/trigger-authoring-guide.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| <!--skill-flavor:trigger-binding-rule:start--> | ||
| 2. **Studio Web owns the trigger's deployment registration.** It derives the `EventTrigger` binding from the saved workflow; treat host-generated bindings and solution resources as authoritative (rule 16). Keep the trigger first and its `objectName` / `eventType` / `eventMode` / `filterExpression` accurate. After saving, confirm the activity renders as a **trigger card**; a plain connector card means wrong event metadata, so re-stub. | ||
| <!--skill-flavor:trigger-binding-rule:end--> | ||
|
|
||
| <!--skill-flavor:trigger-schedule-scope:start--> | ||
| 4. **Only connector events live in the workflow file.** A schedule is an Orchestrator trigger on the deployed process, managed outside the workflow. See [operating-published-workflows.md](operating-published-workflows.md). | ||
| <!--skill-flavor:trigger-schedule-scope:end--> | ||
|
|
||
| <!--skill-flavor:trigger-authoring-steps:start--> | ||
| 1. `uip api-workflow registry resolve "<KEYWORD>" --kind trigger --output json` → trigger type id | ||
| 2. `uip is connections list <connector-key> --output json` → connection UUID, then `uip is connections ping <CONNECTION_UUID> --output json` — REQUIRED | ||
| 3. `GenericTrigger` only: `uip is triggers objects <connector-key> <EVENT> --connection-id <CONNECTION_UUID> --output json` → object name | ||
| 4. `uip is triggers describe <connector-key> <EVENT> <OBJECT> --connection-id <CONNECTION_UUID> --output json` → event parameters | ||
| 5. `uip api-workflow registry stub <TRIGGER_TYPE_ID> --connection-id <CONNECTION_UUID> [--object-name <OBJECT>] [--inputs '<json>'] --output json` | ||
| 6. Insert `Data.Activity` as the first entry after `WorkflowStart` in `/solution/<projectName>/Workflow.json` and save. | ||
| 7. From that project directory, `uip api-workflow validate Workflow.json --output json` until `Data.Status` is `Valid`. | ||
| <!--skill-flavor:trigger-authoring-steps:end--> | ||
|
|
||
| <!--skill-flavor:trigger-kind-unavailable:start--> | ||
| If `resolve` answers `unknown option '--kind'`, the embedded CLI predates trigger support. Report that host capability gap and ask how the user wants to proceed; hand-authoring is not the fallback (rule 3). | ||
| <!--skill-flavor:trigger-kind-unavailable:end--> | ||
|
|
||
| <!--skill-flavor:trigger-binding-command:start--> | ||
| Studio Web derives it from the saved workflow, including the `Property` entry for the event parameters the connector registers with. Treat host-generated bindings and solution resources as authoritative (rule 16). After saving, confirm the activity renders as a **trigger card**; re-stub if it renders as a plain connector card. | ||
| <!--skill-flavor:trigger-binding-command:end--> | ||
|
|
||
| <!--skill-flavor:trigger-local-run:start--> | ||
| Run through the consent-gated, schema-inspected `RunProject` host operation: | ||
|
|
||
| | Input | Result | | ||
| |---|---| | ||
| | Execution input shaped like `outputFields` | The trigger passes it through as the event payload; no connector call. The safe way to exercise the body. | | ||
| | No input | The runtime fetches a recent matching event through the live connection: always for `polling`; for `webhooks` only when the connector has a debug-polling configuration, otherwise it fails with publish guidance. Reaches the vendor; side-effecting under rule 21. | | ||
|
|
||
| Studio Web's **Test trigger** panel checks filter matches against recent events without running the workflow. Offline `uip api-workflow validate` stays the autonomous pre-flight. | ||
| <!--skill-flavor:trigger-local-run:end--> | ||
|
|
||
| <!--skill-flavor:trigger-clean-gate-antipattern:start--> | ||
| A clean `uip api-workflow validate` proves the file is well formed, and only that. The subscription follows from the saved trigger activity (rule 2), so re-read it before calling the work done. | ||
| <!--skill-flavor:trigger-clean-gate-antipattern:end--> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
skills/uipath-api-workflow/assets/templates/trigger-workflow-template.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| { | ||
| "document": { | ||
| "dsl": "1.0.0", | ||
| "name": "Workflow", | ||
| "tags": {}, | ||
| "version": "0.0.1", | ||
| "namespace": "default", | ||
| "metadata": { | ||
| "variables": [] | ||
| } | ||
| }, | ||
| "do": [ | ||
| { | ||
| "Sequence_1": { | ||
| "do": [ | ||
| { | ||
| "WorkflowStart": { | ||
| "set": "${ { ...Object.entries($workflow.definition?.document?.metadata?.variables?.schema?.document?.properties || {}).reduce((acc, [name, def]) => ({ ...acc, [name]: def?.default }), {}), ...($workflow.input || {}) } }", | ||
| "output": { | ||
| "as": "${$input}" | ||
| }, | ||
| "export": { | ||
| "as": "{ ...$context, variables: { ...$context.variables, ...$output } }" | ||
| }, | ||
| "metadata": { | ||
| "activityType": "Assign", | ||
| "displayName": "Workflow start", | ||
| "fullName": "Assign", | ||
| "isTransparent": true | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "Button_Clicked_1": { | ||
| "call": "UiPath.IntSvcEvent", | ||
| "with": { | ||
| "connector": "uipath-salesforce-slack", | ||
| "connectionId": "<REPLACE_WITH_VENDOR_CONNECTION_UUID>", | ||
| "connectionResourceId": "<REPLACE_WITH_VENDOR_CONNECTION_UUID>", | ||
| "eventParameters": { | ||
| "channel_id": "<CHANNEL_ID>" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The template and the offline seed contradict the guide. is triggers describe marks both user_id and channel_id as |
||
| }, | ||
| "objectName": "button", | ||
| "eventType": "BUTTON_CLICKED", | ||
| "eventMode": "webhooks", | ||
| "filterExpression": "(channel_id == '<CHANNEL_ID>')" | ||
| }, | ||
| "export": { | ||
| "as": "{ ...$context, outputs: { ...$context?.outputs, \"button_1\": $output } }" | ||
| }, | ||
| "metadata": { | ||
| "activityType": "Connector", | ||
| "fullName": "Connector", | ||
| "displayName": "Button Clicked", | ||
| "uiPathActivityTypeId": "<REPLACE_WITH_TRIGGER_TYPE_ID>", | ||
| "configuration": "{\"essentialConfiguration\": {\"connectorVersion\": \"\", \"executionType\": null, \"scriptRef\": null, \"customFieldsRequestDetails\": null, \"instanceParameters\": {\"connectorKey\": \"uipath-salesforce-slack\", \"objectName\": \"button\", \"activityType\": \"CuratedTrigger\", \"version\": \"1.0.0\", \"eventOperation\": \"BUTTON_CLICKED\", \"eventMode\": \"webhooks\", \"supportsStreaming\": false}, \"objectName\": \"button\", \"packageVersion\": \"1.0.0\", \"httpMethod\": null, \"path\": null, \"filter\": null}}" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "Response_1": { | ||
| "response": "${{ clicked: $context.outputs.button_1?.content }}", | ||
| "markJobAsFailed": false, | ||
| "then": "end", | ||
| "metadata": { | ||
| "activityType": "Response", | ||
| "displayName": "Response", | ||
| "fullName": "Response" | ||
| } | ||
| } | ||
| } | ||
| ], | ||
| "metadata": { | ||
| "activityType": "Sequence", | ||
| "displayName": "Sequence", | ||
| "fullName": "Sequence" | ||
| } | ||
| } | ||
| } | ||
| ], | ||
| "evaluate": { | ||
| "mode": "strict", | ||
| "language": "javascript" | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A placeholder connection gets registered silently. bindings sync writes an EventTrigger keyed
<REPLACE_WITH_VENDOR_CONNECTION_UUID> with no warning. The e2e check that the key is non-empty accepts it.