windmill-components 1.642.0 → 1.655.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/appPolicy/myFunction.es.js +1337 -0
- package/dist/sharedUtils/common.d.ts +2 -5
- package/dist/sharedUtils/components/apps/components/display/dbtable/queries/select.d.ts +0 -2
- package/dist/sharedUtils/components/apps/components/display/dbtable/utils.d.ts +3 -14
- package/dist/sharedUtils/components/apps/editor/appPolicy.d.ts +1 -1
- package/dist/sharedUtils/components/apps/editor/appUtilsS3.d.ts +1 -12
- package/dist/sharedUtils/components/apps/editor/component/components.d.ts +2 -68
- package/dist/sharedUtils/components/apps/inputType.d.ts +2 -4
- package/dist/sharedUtils/components/apps/sharedTypes.d.ts +0 -2
- package/dist/sharedUtils/components/dbTypes.d.ts +0 -3
- package/dist/sharedUtils/components/raw_apps/rawAppPolicy.d.ts +1 -1
- package/dist/sharedUtils/components/raw_apps/utils.d.ts +1 -1
- package/dist/sharedUtils/components/triggers/utils.d.ts +3 -2
- package/dist/sharedUtils/gen/schemas.gen.d.ts +71 -915
- package/dist/sharedUtils/gen/services.gen.d.ts +23 -329
- package/dist/sharedUtils/gen/types.gen.d.ts +141 -1870
- package/dist/sharedUtils/hub.d.ts +0 -1
- package/dist/sharedUtils/jsr.json +5 -5
- package/dist/sharedUtils/lib.d.ts +1 -1
- package/dist/sharedUtils/lib.es.js +79 -241
- package/dist/sharedUtils/package.json +11 -11
- package/dist/sharedUtils/stores.d.ts +0 -1
- package/dist/sharedUtils/svelte5Utils.svelte.d.ts +1 -32
- package/dist/sharedUtils/utils.d.ts +4 -19
- package/package/aiStore.d.ts +1 -0
- package/package/aiStore.js +3 -0
- package/package/components/ApiConnectForm.svelte +7 -0
- package/package/components/ApiConnectForm.svelte.d.ts +1 -1
- package/package/components/AppConnectDrawer.svelte +18 -15
- package/package/components/AppConnectDrawer.svelte.d.ts +5 -5
- package/package/components/AppConnectInner.svelte +2 -0
- package/package/components/AppConnectLightweightResourcePicker.svelte +3 -3
- package/package/components/AppWrapper.svelte +3 -2
- package/package/components/ArgInput.svelte +1 -0
- package/package/components/AutheliaSetting.svelte +9 -6
- package/package/components/AutheliaSetting.svelte.d.ts +4 -18
- package/package/components/AuthentikSetting.svelte +10 -7
- package/package/components/AuthentikSetting.svelte.d.ts +4 -18
- package/package/components/AzureOauthSettings.svelte +23 -23
- package/package/components/AzureOauthSettings.svelte.d.ts +4 -18
- package/package/components/Badge.svelte +2 -4
- package/package/components/Badge.svelte.d.ts +5 -27
- package/package/components/ChangeInstanceUsernameInner.svelte +4 -7
- package/package/components/ChangeInstanceUsernameInner.svelte.d.ts +8 -7
- package/package/components/ChannelSelector.svelte +19 -15
- package/package/components/CompareWorkspaces.svelte +618 -650
- package/package/components/ContextualVariableEditor.svelte +8 -8
- package/package/components/ContextualVariableEditor.svelte.d.ts +3 -6
- package/package/components/CustomOauth.svelte +19 -23
- package/package/components/CustomOauth.svelte.d.ts +4 -26
- package/package/components/CustomPopover.svelte +3 -2
- package/package/components/CustomSso.svelte +20 -25
- package/package/components/CustomSso.svelte.d.ts +4 -27
- package/package/components/DBManagerDrawer.svelte +26 -44
- package/package/components/DBManagerDrawer.svelte.d.ts +3 -5
- package/package/components/DBSchemaExplorer.svelte +3 -3
- package/package/components/DBTableEditor.svelte +6 -6
- package/package/components/DatatablePicker.svelte +1 -3
- package/package/components/DateInput.svelte +1 -0
- package/package/components/DateTimeInput.svelte +1 -0
- package/package/components/DefaultScripts.svelte +3 -5
- package/package/components/DefaultScripts.svelte.d.ts +6 -20
- package/package/components/DefaultScriptsInner.svelte +4 -4
- package/package/components/DefaultScriptsInner.svelte.d.ts +4 -18
- package/package/components/DeployWorkspace.svelte +222 -470
- package/package/components/DeployWorkspaceDrawer.svelte +1 -10
- package/package/components/Description.svelte +3 -3
- package/package/components/Description.svelte.d.ts +6 -28
- package/package/components/Dev.svelte +15 -14
- package/package/components/DiffEditor.svelte +2 -2
- package/package/components/DisplayResult.svelte.d.ts +1 -1
- package/package/components/DropdownSubmenuItem.svelte +3 -2
- package/package/components/DropdownV2.svelte +1 -1
- package/package/components/DropdownV2.svelte.d.ts +2 -2
- package/package/components/DropdownV2Inner.svelte +3 -0
- package/package/components/DucklakePicker.svelte +1 -3
- package/package/components/DurationMs.svelte +1 -3
- package/package/components/DurationMs.svelte.d.ts +4 -18
- package/package/components/DynamicInput.svelte +2 -2
- package/package/components/EditableSchemaForm.svelte +4 -4
- package/package/components/Editor.svelte +9 -11
- package/package/components/EditorBar.svelte +2 -2
- package/package/components/EditorBar.svelte.d.ts +1 -1
- package/package/components/ExecutionDuration.svelte +12 -20
- package/package/components/ExecutionDuration.svelte.d.ts +14 -24
- package/package/components/ExploreAssetButton.svelte +13 -6
- package/package/components/ExploreAssetButton.svelte.d.ts +0 -2
- package/package/components/FakeMonacoPlaceHolder.svelte +3 -2
- package/package/components/FieldHeader.svelte +6 -16
- package/package/components/FieldHeader.svelte.d.ts +5 -20
- package/package/components/FilesetEditor.svelte +23 -0
- package/package/components/FilterSearchbar.svelte +44 -11
- package/package/components/FilterSearchbar.svelte.d.ts +1 -0
- package/package/components/FlowBuilder.svelte +47 -28
- package/package/components/FlowGraphViewer.svelte +1 -10
- package/package/components/FlowGraphViewer.svelte.d.ts +17 -16
- package/package/components/FlowGraphViewerStep.svelte +5 -7
- package/package/components/FlowGraphViewerStep.svelte.d.ts +4 -18
- package/package/components/FlowHistoryJobPicker.svelte +4 -2
- package/package/components/FlowHistoryJobPicker.svelte.d.ts +1 -0
- package/package/components/FlowInputViewer.svelte +1 -1
- package/package/components/FlowInputViewer.svelte.d.ts +4 -18
- package/package/components/FlowLogViewer.svelte +6 -4
- package/package/components/FlowLogViewerWrapper.svelte +2 -2
- package/package/components/FlowPlugConnect.svelte +1 -3
- package/package/components/FlowPlugConnect.svelte.d.ts +7 -6
- package/package/components/FlowPreviewContent.svelte +111 -6
- package/package/components/FlowPreviewContent.svelte.d.ts +1 -0
- package/package/components/FlowStatusViewer.svelte +6 -6
- package/package/components/FlowStatusViewerInner.svelte +99 -86
- package/package/components/FlowViewer.svelte +6 -4
- package/package/components/FlowWrapper.svelte +5 -4
- package/package/components/FolderEditor.svelte +9 -7
- package/package/components/FolderUsageInfo.svelte +7 -6
- package/package/components/FolderUsageInfo.svelte.d.ts +5 -19
- package/package/components/GraphqlSchemaViewer.svelte +3 -3
- package/package/components/GraphqlSchemaViewer.svelte.d.ts +5 -19
- package/package/components/GroupEditor.svelte +22 -10
- package/package/components/IdEditorInput.svelte +3 -2
- package/package/components/InputTransformForm.svelte +2 -0
- package/package/components/InputTransformSchemaForm.svelte.d.ts +1 -1
- package/package/components/InputTransformsViewer.svelte +2 -2
- package/package/components/InputTransformsViewer.svelte.d.ts +4 -18
- package/package/components/InstanceGroupEditor.svelte +28 -23
- package/package/components/InstanceGroupEditor.svelte.d.ts +5 -4
- package/package/components/InstanceNameEditor.svelte +19 -19
- package/package/components/InstanceNameEditor.svelte.d.ts +9 -9
- package/package/components/InstanceSetting.svelte +8 -2
- package/package/components/InstanceSettings.svelte +36 -22
- package/package/components/InviteGlobalUser.svelte +4 -4
- package/package/components/InviteGlobalUser.svelte.d.ts +5 -4
- package/package/components/JobLoader.svelte +51 -1
- package/package/components/KanidmSetting.svelte +15 -12
- package/package/components/KanidmSetting.svelte.d.ts +4 -18
- package/package/components/KeycloakSetting.svelte +18 -9
- package/package/components/KeycloakSetting.svelte.d.ts +4 -18
- package/package/components/LogId.svelte +5 -2
- package/package/components/LogId.svelte.d.ts +4 -18
- package/package/components/LogSnippetViewer.svelte +5 -5
- package/package/components/LogSnippetViewer.svelte.d.ts +5 -20
- package/package/components/LogViewer.svelte +2 -2
- package/package/components/ManualPopover.svelte +4 -1
- package/package/components/MapResult.svelte +33 -33
- package/package/components/MapResult.svelte.d.ts +13 -26
- package/package/components/MemoryFootprintViewer.svelte +8 -6
- package/package/components/MemoryFootprintViewer.svelte.d.ts +4 -18
- package/package/components/ModulePreview.svelte.d.ts +1 -1
- package/package/components/ModuleStatus.svelte +1 -3
- package/package/components/ModuleStatus.svelte.d.ts +5 -19
- package/package/components/ModuleTest.svelte +3 -3
- package/package/components/ModuleTest.svelte.d.ts +1 -1
- package/package/components/OAuthSetting.svelte +57 -41
- package/package/components/OauthExtraParams.svelte +9 -4
- package/package/components/OauthExtraParams.svelte.d.ts +4 -18
- package/package/components/OauthScopes.svelte +9 -4
- package/package/components/OauthScopes.svelte.d.ts +4 -18
- package/package/components/ObjectResourceInput.svelte +10 -3
- package/package/components/ObjectResourceInput.svelte.d.ts +1 -0
- package/package/components/OnBehalfOfSelector.svelte +191 -0
- package/package/components/OnBehalfOfSelector.svelte.d.ts +21 -0
- package/package/components/PageHeader.svelte +3 -7
- package/package/components/PageHeader.svelte.d.ts +5 -27
- package/package/components/ParqetCsvTableRenderer.svelte +12 -12
- package/package/components/ParqetCsvTableRenderer.svelte.d.ts +4 -18
- package/package/components/PermissionHistory.svelte +8 -6
- package/package/components/PersistentScriptDrawer.svelte +56 -50
- package/package/components/PersistentScriptDrawer.svelte.d.ts +3 -5
- package/package/components/Popover.svelte +2 -2
- package/package/components/PrefixedInput.svelte +2 -2
- package/package/components/QueueMetricsDrawer.svelte +1 -1
- package/package/components/QueueMetricsDrawer.svelte.d.ts +3 -20
- package/package/components/QueueMetricsDrawerInner.svelte +14 -9
- package/package/components/QueueMetricsDrawerInner.svelte.d.ts +2 -17
- package/package/components/RadioButton.svelte +3 -8
- package/package/components/RadioButton.svelte.d.ts +13 -12
- package/package/components/Range.svelte +15 -18
- package/package/components/Range.svelte.d.ts +5 -21
- package/package/components/RepositorySelector.svelte +3 -2
- package/package/components/Required.svelte +4 -4
- package/package/components/Required.svelte.d.ts +6 -20
- package/package/components/ResourceEditor.svelte +22 -5
- package/package/components/ResourceEditor.svelte.d.ts +0 -1
- package/package/components/ResourceEditorDrawer.svelte +11 -16
- package/package/components/ResourceEditorDrawer.svelte.d.ts +3 -6
- package/package/components/ResourcePicker.svelte +35 -17
- package/package/components/ResourcePicker.svelte.d.ts +1 -0
- package/package/components/RunForm.svelte +2 -2
- package/package/components/RunFormAdvancedPopup.svelte +1 -4
- package/package/components/RunFormAdvancedPopup.svelte.d.ts +4 -18
- package/package/components/RunsPage.svelte +126 -27
- package/package/components/S3FilePicker.svelte +2 -1
- package/package/components/S3FilePicker.svelte.d.ts +1 -0
- package/package/components/S3FilePickerInner.svelte +19 -7
- package/package/components/S3FilePickerInner.svelte.d.ts +1 -0
- package/package/components/S3ObjectPicker.svelte +4 -5
- package/package/components/S3ObjectPicker.svelte.d.ts +6 -6
- package/package/components/SaveButton.svelte +2 -0
- package/package/components/SaveInputsButton.svelte +2 -7
- package/package/components/SaveInputsButton.svelte.d.ts +10 -9
- package/package/components/SavedInputsPickerViewer.svelte +21 -22
- package/package/components/SavedInputsPickerViewer.svelte.d.ts +10 -10
- package/package/components/SchemaEditorProperty.svelte +1 -1
- package/package/components/SchemaEditorProperty.svelte.d.ts +4 -18
- package/package/components/SchemaForm.svelte.d.ts +1 -1
- package/package/components/ScriptBuilder.svelte +113 -30
- package/package/components/ScriptEditor.svelte +90 -34
- package/package/components/ScriptEditor.svelte.d.ts +2 -2
- package/package/components/ScriptPicker.svelte +1 -1
- package/package/components/ScriptWrapper.svelte +3 -2
- package/package/components/Scrollable.svelte +10 -10
- package/package/components/Scrollable.svelte.d.ts +6 -29
- package/package/components/SearchItems.svelte +1 -1
- package/package/components/ServiceLogsInner.svelte +15 -9
- package/package/components/ShareModal.svelte +15 -8
- package/package/components/ShareModal.svelte.d.ts +1 -1
- package/package/components/SimpleEditor.svelte +1 -1
- package/package/components/Slider.svelte +2 -5
- package/package/components/Slider.svelte.d.ts +6 -28
- package/package/components/StringTypeNarrowing.svelte +3 -2
- package/package/components/Subsection.svelte +3 -2
- package/package/components/Summary.svelte +1 -2
- package/package/components/Summary.svelte.d.ts +4 -18
- package/package/components/SupabaseConnect.svelte +20 -17
- package/package/components/SupabaseConnect.svelte.d.ts +3 -5
- package/package/components/SuperadminSettings.svelte +11 -9
- package/package/components/SuperadminSettingsInner.svelte +3 -3
- package/package/components/TableCustom.svelte +6 -8
- package/package/components/TableCustom.svelte.d.ts +10 -10
- package/package/components/TeamSelector.svelte +20 -14
- package/package/components/TemplateEditor.svelte +1 -7
- package/package/components/TestConnection.svelte +2 -5
- package/package/components/TestConnection.svelte.d.ts +4 -18
- package/package/components/TimelineBar.svelte +5 -2
- package/package/components/Toast.svelte +2 -2
- package/package/components/Toggle.svelte +2 -2
- package/package/components/Tooltip.svelte +3 -16
- package/package/components/Tooltip.svelte.d.ts +4 -1
- package/package/components/TooltipInner.svelte +3 -14
- package/package/components/TooltipInner.svelte.d.ts +5 -28
- package/package/components/Uptodate.svelte +1 -1
- package/package/components/Uptodate.svelte.d.ts +2 -17
- package/package/components/Urlize.svelte +2 -2
- package/package/components/Urlize.svelte.d.ts +4 -18
- package/package/components/Version.svelte +1 -1
- package/package/components/Version.svelte.d.ts +2 -17
- package/package/components/WhitelistIp.svelte +1 -1
- package/package/components/WhitelistIp.svelte.d.ts +2 -17
- package/package/components/WorkerGroup.svelte +1 -5
- package/package/components/WorkerRepl.svelte +1 -2
- package/package/components/WorkflowTimeline.svelte +10 -14
- package/package/components/WorkflowTimeline.svelte.d.ts +4 -18
- package/package/components/WorkspaceDependenciesEditor.svelte +1 -1
- package/package/components/WorkspaceDeployLayout.svelte +107 -0
- package/package/components/WorkspaceDeployLayout.svelte.d.ts +31 -0
- package/package/components/ZitadelSetting.svelte +9 -6
- package/package/components/ZitadelSetting.svelte.d.ts +4 -18
- package/package/components/apps/components/GroupWrapper.svelte +5 -2
- package/package/components/apps/components/buttons/AppButton.svelte +6 -5
- package/package/components/apps/components/buttons/AppForm.svelte +5 -5
- package/package/components/apps/components/buttons/AppFormButton.svelte +5 -5
- package/package/components/apps/components/buttons/AppSchemaForm.svelte +5 -4
- package/package/components/apps/components/display/AppAccordionList.svelte +4 -4
- package/package/components/apps/components/display/AppAlert.svelte +4 -4
- package/package/components/apps/components/display/AppBarChart.svelte +4 -4
- package/package/components/apps/components/display/AppCarouselList.svelte +5 -5
- package/package/components/apps/components/display/AppChartJs.svelte +4 -4
- package/package/components/apps/components/display/AppChartJsV2.svelte +4 -4
- package/package/components/apps/components/display/AppChat.svelte +5 -5
- package/package/components/apps/components/display/AppCustomComponent.svelte +3 -3
- package/package/components/apps/components/display/AppDisplayComponent.svelte +5 -5
- package/package/components/apps/components/display/AppDisplayComponentByJobId.svelte +3 -3
- package/package/components/apps/components/display/AppDownload.svelte +3 -3
- package/package/components/apps/components/display/AppHtml.svelte +4 -3
- package/package/components/apps/components/display/AppIcon.svelte +4 -4
- package/package/components/apps/components/display/AppImage.svelte +4 -4
- package/package/components/apps/components/display/AppJobIdFlowStatus.svelte +4 -4
- package/package/components/apps/components/display/AppJobIdLogComponent.svelte +3 -3
- package/package/components/apps/components/display/AppJobProgressBar.svelte +3 -3
- package/package/components/apps/components/display/AppMap.svelte +6 -4
- package/package/components/apps/components/display/AppMarkdown.svelte +5 -4
- package/package/components/apps/components/display/AppMenu.svelte +4 -3
- package/package/components/apps/components/display/AppNavbar.svelte +4 -4
- package/package/components/apps/components/display/AppPdf.svelte +3 -3
- package/package/components/apps/components/display/AppPieChart.svelte +3 -3
- package/package/components/apps/components/display/AppRecomputeAll.svelte +3 -3
- package/package/components/apps/components/display/AppScatterChart.svelte +3 -3
- package/package/components/apps/components/display/AppStatCard.svelte +3 -3
- package/package/components/apps/components/display/AppText.svelte +10 -8
- package/package/components/apps/components/display/AppTimeseries.svelte +3 -3
- package/package/components/apps/components/display/InsertRowDrawerButton.svelte +1 -1
- package/package/components/apps/components/display/PlotlyHtml.svelte +3 -2
- package/package/components/apps/components/display/PlotlyHtmlV2.svelte +3 -2
- package/package/components/apps/components/display/ResolveNavbarItemPath.svelte +3 -2
- package/package/components/apps/components/display/VegaLiteHtml.svelte +3 -2
- package/package/components/apps/components/display/charts/AppAgCharts.svelte +3 -3
- package/package/components/apps/components/display/dbtable/AppDbExplorer.svelte +2 -2
- package/package/components/apps/components/display/dbtable/DbExplorerCount.svelte +3 -3
- package/package/components/apps/components/display/dbtable/DeleteRow.svelte +2 -2
- package/package/components/apps/components/display/dbtable/InsertRowRunnable.svelte +2 -2
- package/package/components/apps/components/display/dbtable/UpdateCell.svelte +2 -2
- package/package/components/apps/components/display/dbtable/metadata.js +9 -4
- package/package/components/apps/components/display/dbtable/utils.d.ts +3 -3
- package/package/components/apps/components/display/dbtable/utils.js +3 -3
- package/package/components/apps/components/display/table/AppAggridExplorerTable.svelte +8 -4
- package/package/components/apps/components/display/table/AppAggridExplorerTable.svelte.d.ts +1 -1
- package/package/components/apps/components/display/table/AppAggridInfiniteTable.svelte +3 -3
- package/package/components/apps/components/display/table/AppAggridTable.svelte +4 -3
- package/package/components/apps/components/display/table/AppAggridTableActions.svelte +3 -3
- package/package/components/apps/components/display/table/AppTable.svelte +4 -4
- package/package/components/apps/components/helpers/HiddenComponent.svelte +2 -2
- package/package/components/apps/components/helpers/InputValue.svelte +3 -3
- package/package/components/apps/components/helpers/RunnableComponent.svelte +2 -2
- package/package/components/apps/components/helpers/RunnableWrapper.svelte +2 -2
- package/package/components/apps/components/inputs/AppCheckbox.svelte +6 -6
- package/package/components/apps/components/inputs/AppCodeInputComponent.svelte +6 -5
- package/package/components/apps/components/inputs/AppDateInput.svelte +4 -4
- package/package/components/apps/components/inputs/AppDateSelect.svelte +4 -4
- package/package/components/apps/components/inputs/AppDateSliderInput.svelte +5 -4
- package/package/components/apps/components/inputs/AppDateTimeInput.svelte +4 -4
- package/package/components/apps/components/inputs/AppFileInput.svelte +4 -4
- package/package/components/apps/components/inputs/AppMultiSelectV2.svelte +5 -4
- package/package/components/apps/components/inputs/AppNumberInput.svelte +4 -4
- package/package/components/apps/components/inputs/AppQuillEditor.svelte +3 -2
- package/package/components/apps/components/inputs/AppRangeInput.svelte +5 -4
- package/package/components/apps/components/inputs/AppS3FileInput.svelte +4 -4
- package/package/components/apps/components/inputs/AppSelect.svelte +8 -7
- package/package/components/apps/components/inputs/AppSelectStep.svelte +5 -4
- package/package/components/apps/components/inputs/AppSelectTab.svelte +4 -4
- package/package/components/apps/components/inputs/AppSliderInputs.svelte +5 -4
- package/package/components/apps/components/inputs/AppTextInput.svelte +4 -4
- package/package/components/apps/components/inputs/AppTimeInput.svelte +4 -4
- package/package/components/apps/components/inputs/AppUserResource.svelte +4 -4
- package/package/components/apps/components/inputs/currency/AppCurrencyInput.svelte +5 -4
- package/package/components/apps/components/inputs/currency/CurrencyInput.svelte +3 -1
- package/package/components/apps/components/layout/AppConditionalWrapper.svelte +5 -5
- package/package/components/apps/components/layout/AppContainer.svelte +3 -3
- package/package/components/apps/components/layout/AppDecisionTree.svelte +5 -5
- package/package/components/apps/components/layout/AppDivider.svelte +3 -3
- package/package/components/apps/components/layout/AppDrawer.svelte +7 -6
- package/package/components/apps/components/layout/AppList.svelte +5 -5
- package/package/components/apps/components/layout/AppModal.svelte +7 -6
- package/package/components/apps/components/layout/AppSplitpanes.svelte +8 -6
- package/package/components/apps/components/layout/AppStepper.svelte +6 -6
- package/package/components/apps/components/layout/AppTabs.svelte +8 -8
- package/package/components/apps/components/layout/ListWrapper.svelte +6 -2
- package/package/components/apps/components/layout/RowWrapper.svelte +6 -2
- package/package/components/apps/editor/AppEditor.svelte +11 -11
- package/package/components/apps/editor/AppEditorHeader.svelte +21 -4
- package/package/components/apps/editor/AppEditorHeaderDeploy.svelte +41 -1
- package/package/components/apps/editor/AppEditorHeaderDeploy.svelte.d.ts +2 -1
- package/package/components/apps/editor/AppExportButton.svelte +4 -4
- package/package/components/apps/editor/AppExportButton.svelte.d.ts +3 -20
- package/package/components/apps/editor/AppInputs.svelte +1 -1
- package/package/components/apps/editor/AppInputs.svelte.d.ts +2 -17
- package/package/components/apps/editor/AppJsonEditor.svelte +5 -5
- package/package/components/apps/editor/AppJsonEditor.svelte.d.ts +3 -7
- package/package/components/apps/editor/AppPreview.svelte +17 -16
- package/package/components/apps/editor/ComponentHeader.svelte +1 -1
- package/package/components/apps/editor/DecisionTreeDebug.svelte +4 -4
- package/package/components/apps/editor/GridEditor.svelte +1 -0
- package/package/components/apps/editor/GridViewer.svelte +3 -3
- package/package/components/apps/editor/RecomputeAllComponents.svelte +13 -8
- package/package/components/apps/editor/RecomputeAllComponents.svelte.d.ts +2 -17
- package/package/components/apps/editor/SubGridEditor.svelte +4 -2
- package/package/components/apps/editor/appPolicy.js +1 -1
- package/package/components/apps/editor/commonAppUtils.d.ts +1 -1
- package/package/components/apps/editor/commonAppUtils.js +1 -1
- package/package/components/apps/editor/component/Component.svelte +2 -2
- package/package/components/apps/editor/component/components.d.ts +8 -2
- package/package/components/apps/editor/component/components.js +26 -39
- package/package/components/apps/editor/componentsPanel/CssHelperPanel.svelte +10 -7
- package/package/components/apps/editor/componentsPanel/CssHelperPanel.svelte.d.ts +1 -1
- package/package/components/apps/editor/componentsPanel/CustomComponentsList.svelte +7 -7
- package/package/components/apps/editor/componentsPanel/CustomComponentsList.svelte.d.ts +1 -1
- package/package/components/apps/editor/componentsPanel/NameEditor.svelte +2 -2
- package/package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte +3 -4
- package/package/components/apps/editor/componentsPanel/QuickStyleProperty.svelte +3 -3
- package/package/components/apps/editor/componentsPanel/ThemeList.svelte +5 -5
- package/package/components/apps/editor/componentsPanel/ThemeList.svelte.d.ts +1 -1
- package/package/components/apps/editor/componentsPanel/ThemeNameEditor.svelte +2 -2
- package/package/components/apps/editor/contextPanel/ComponentOutput.svelte +2 -2
- package/package/components/apps/editor/contextPanel/DebugPanel.svelte +4 -4
- package/package/components/apps/editor/contextPanel/DebugPanel.svelte.d.ts +2 -17
- package/package/components/apps/editor/contextPanel/components/Output.svelte +6 -1
- package/package/components/apps/editor/contextPanel/components/Output.svelte.d.ts +1 -0
- package/package/components/apps/editor/contextPanel/components/TableActionsOutput.svelte +14 -2
- package/package/components/apps/editor/settingsPanel/ComponentControl.svelte +3 -2
- package/package/components/apps/editor/settingsPanel/ContextVariables.svelte +6 -6
- package/package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +4 -4
- package/package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +0 -1
- package/package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +1 -2
- package/package/components/apps/editor/settingsPanel/common/PanelSection.svelte +3 -2
- package/package/components/apps/editor/settingsPanel/inputEditor/UploadInputEditor.svelte +6 -5
- package/package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +2 -2
- package/package/components/apps/editor/settingsPanel/secondaryMenu/SecondaryMenu.svelte +3 -2
- package/package/components/apps/svelte-grid/Grid.svelte +4 -4
- package/package/components/apps/svelte-grid/MoveResize.svelte +5 -5
- package/package/components/assets/AssetButtons.svelte +31 -27
- package/package/components/assets/AssetButtons.svelte.d.ts +0 -1
- package/package/components/assets/AssetColumnBadges.svelte +5 -3
- package/package/components/assets/AssetsDropdownButton.svelte +11 -13
- package/package/components/assets/AssetsUsageDrawer.svelte +7 -5
- package/package/components/assets/JobAssetsViewer.svelte +11 -5
- package/package/components/assets/VolumeDetailDrawer.svelte +101 -0
- package/package/components/assets/VolumeDetailDrawer.svelte.d.ts +9 -0
- package/package/components/assets/VolumesDrawer.svelte +191 -0
- package/package/components/assets/VolumesDrawer.svelte.d.ts +8 -0
- package/package/components/assets/assetsFilter.d.ts +4 -0
- package/package/components/assets/assetsFilter.js +4 -0
- package/package/components/assets/lib.js +4 -0
- package/package/components/auditLogs/AuditLogsFilters.svelte +4 -7
- package/package/components/chartjs-wrappers/Chart.svelte +4 -4
- package/package/components/common/FileProgressBar.svelte +9 -7
- package/package/components/common/FileProgressBar.svelte.d.ts +5 -27
- package/package/components/common/InlineCalendarInput.svelte +5 -1
- package/package/components/common/alert/Notification.svelte +2 -2
- package/package/components/common/alert/Notification.svelte.d.ts +4 -18
- package/package/components/common/button/AnimatedButton.svelte +3 -9
- package/package/components/common/button/AnimatedButton.svelte.d.ts +5 -27
- package/package/components/common/button/AnimatedButtonInner.svelte +6 -12
- package/package/components/common/button/AnimatedButtonInner.svelte.d.ts +5 -27
- package/package/components/common/button/Button.svelte +5 -5
- package/package/components/common/button/PulseButton.svelte +15 -19
- package/package/components/common/button/PulseButton.svelte.d.ts +10 -48
- package/package/components/common/button/RefreshButton.svelte +3 -2
- package/package/components/common/button/RefreshButton.svelte.d.ts +1 -1
- package/package/components/common/button/RoundIconButton.svelte +5 -5
- package/package/components/common/button/RoundIconButton.svelte.d.ts +6 -28
- package/package/components/common/button/UndoRedo.svelte +1 -2
- package/package/components/common/button/UndoRedo.svelte.d.ts +6 -5
- package/package/components/common/calendarPicker/CalendarPicker.svelte +44 -43
- package/package/components/common/calendarPicker/CalendarPicker.svelte.d.ts +11 -11
- package/package/components/common/clearableInput/ClearableInput.svelte +28 -27
- package/package/components/common/clearableInput/ClearableInput.svelte.d.ts +11 -37
- package/package/components/common/confirmationModal/ConfirmationModal.svelte +1 -1
- package/package/components/common/confirmationModal/DraftTriggersConfirmationModal.svelte +2 -2
- package/package/components/common/confirmationModal/UnsavedConfirmationModal.svelte +3 -3
- package/package/components/common/contextmenu/ContextMenu.svelte +14 -4
- package/package/components/common/contextmenu/ContextMenu.svelte.d.ts +2 -0
- package/package/components/common/contextmenu/contextMenuStyles.d.ts +4 -0
- package/package/components/common/contextmenu/contextMenuStyles.js +4 -0
- package/package/components/common/drawer/Disposable.svelte +3 -3
- package/package/components/common/fileInput/FileInput.svelte +16 -30
- package/package/components/common/fileInput/FileInput.svelte.d.ts +24 -32
- package/package/components/common/fileUpload/FileUploadModal.svelte +2 -4
- package/package/components/common/fileUpload/FileUploadModal.svelte.d.ts +7 -6
- package/package/components/common/kbd/Kbd.svelte +4 -3
- package/package/components/common/languageIcons/LanguageIcon.svelte +21 -4
- package/package/components/common/languageIcons/LanguageIcon.svelte.d.ts +1 -1
- package/package/components/common/layout/ListElement.svelte +5 -1
- package/package/components/common/layout/ListElement.svelte.d.ts +5 -25
- package/package/components/common/menu/MenuItem.svelte +9 -4
- package/package/components/common/menu/MenuItem.svelte.d.ts +5 -29
- package/package/components/common/menu/ResolveOpen.svelte +6 -3
- package/package/components/common/menu/ResolveOpen.svelte.d.ts +8 -4
- package/package/components/common/modal/AlwaysMountedModal.svelte +11 -15
- package/package/components/common/modal/AlwaysMountedModal.svelte.d.ts +8 -32
- package/package/components/common/modal/Modal2.svelte +12 -20
- package/package/components/common/modal/Modal2.svelte.d.ts +10 -36
- package/package/components/common/popup/PopupV2.svelte +3 -2
- package/package/components/common/stepper/Stepper.svelte +4 -9
- package/package/components/common/stepper/Stepper.svelte.d.ts +10 -9
- package/package/components/common/table/AppRow.svelte +20 -12
- package/package/components/common/table/FlowRow.svelte +17 -9
- package/package/components/common/table/Row.svelte +6 -5
- package/package/components/common/table/Row.svelte.d.ts +2 -1
- package/package/components/common/table/RowIcon.svelte +40 -11
- package/package/components/common/table/RowIcon.svelte.d.ts +6 -18
- package/package/components/common/table/ScriptRow.svelte +37 -27
- package/package/components/common/table/Table.svelte +5 -1
- package/package/components/common/table/Table.svelte.d.ts +5 -25
- package/package/components/common/tabs/Tabs.svelte +2 -2
- package/package/components/common/tabs/TabsV2.svelte +1 -1
- package/package/components/common/toggleButton-v2/ToggleButton.svelte +0 -1
- package/package/components/common/toggleButton-v2/ToggleButtonMore.svelte +10 -5
- package/package/components/common/toggleButton-v2/ToggleButtonMore.svelte.d.ts +1 -0
- package/package/components/copilot/FlowCopilotInputsModal.svelte +14 -13
- package/package/components/copilot/FlowCopilotInputsModal.svelte.d.ts +6 -5
- package/package/components/copilot/MetadataGen.svelte +5 -5
- package/package/components/copilot/RegexGen.svelte +87 -80
- package/package/components/copilot/RegexGen.svelte.d.ts +1 -1
- package/package/components/copilot/ResourceGen.svelte +157 -0
- package/package/components/copilot/ResourceGen.svelte.d.ts +12 -0
- package/package/components/copilot/ScriptFix.svelte +37 -33
- package/package/components/copilot/ScriptGen.svelte +1 -1
- package/package/components/copilot/chat/AIChat.svelte +1 -1
- package/package/components/copilot/chat/AIChatDisplay.svelte +52 -48
- package/package/components/copilot/chat/AIChatInput.svelte +46 -38
- package/package/components/copilot/chat/AIChatManager.svelte.js +4 -2
- package/package/components/copilot/chat/AssistantMessage.svelte +1 -1
- package/package/components/copilot/chat/AssistantMessage.svelte.d.ts +4 -18
- package/package/components/copilot/chat/ChatMode.svelte +37 -33
- package/package/components/copilot/chat/ContextElementBadge.svelte +6 -8
- package/package/components/copilot/chat/flow/AIChangesWarningModal.svelte +8 -11
- package/package/components/copilot/lib.d.ts +3 -2
- package/package/components/copilot/lib.js +25 -29
- package/package/components/custom_ui.d.ts +3 -0
- package/package/components/dbManagerDrawerModel.svelte.d.ts +13 -0
- package/package/components/dbManagerDrawerModel.svelte.js +182 -0
- package/package/components/details/ClipboardPanel.svelte +5 -8
- package/package/components/details/ClipboardPanel.svelte.d.ts +8 -22
- package/package/components/details/ErrorHandlerToggleButton.svelte +1 -4
- package/package/components/details/ErrorHandlerToggleButton.svelte.d.ts +5 -19
- package/package/components/details/ErrorHandlerToggleButtonV2.svelte +2 -6
- package/package/components/details/ErrorHandlerToggleButtonV2.svelte.d.ts +6 -20
- package/package/components/flows/CreateActionsApp.svelte +42 -18
- package/package/components/flows/DebounceLimit.svelte.d.ts +1 -1
- package/package/components/flows/FlowAssetsHandler.svelte +3 -2
- package/package/components/flows/FlowModuleIcon.svelte +4 -3
- package/package/components/flows/common/FlowCardHeader.svelte +3 -2
- package/package/components/flows/content/AgentToolWrapper.svelte +1 -1
- package/package/components/flows/content/DynamicInputHelpBox.svelte +1 -1
- package/package/components/flows/content/DynamicInputHelpBox.svelte.d.ts +2 -17
- package/package/components/flows/content/FlowEditorPanel.svelte +14 -1
- package/package/components/flows/content/FlowEnvironmentVariables.svelte +128 -32
- package/package/components/flows/content/FlowFailureModule.svelte +2 -3
- package/package/components/flows/content/FlowFailureModule.svelte.d.ts +4 -18
- package/package/components/flows/content/FlowInputs.svelte +20 -2
- package/package/components/flows/content/FlowInputsQuick.svelte +21 -0
- package/package/components/flows/content/FlowLoop.svelte +2 -2
- package/package/components/flows/content/FlowModuleComponent.svelte +2 -2
- package/package/components/flows/content/FlowModuleMockTransitionMessage.svelte +13 -13
- package/package/components/flows/content/FlowModuleMockTransitionMessage.svelte.d.ts +2 -17
- package/package/components/flows/content/FlowModuleScript.svelte +1 -1
- package/package/components/flows/content/FlowPathViewer.svelte +7 -5
- package/package/components/flows/content/FlowPathViewer.svelte.d.ts +4 -18
- package/package/components/flows/content/FlowPreprocessorModule.svelte +2 -3
- package/package/components/flows/content/FlowPreprocessorModule.svelte.d.ts +4 -18
- package/package/components/flows/content/FlowSelectionPanel.svelte +34 -10
- package/package/components/flows/content/FlowSelectionPanel.svelte.d.ts +5 -0
- package/package/components/flows/content/FlowSettings.svelte +70 -22
- package/package/components/flows/content/FlowWhileLoop.svelte +2 -1
- package/package/components/flows/content/GenAiQuick.svelte +6 -6
- package/package/components/flows/content/GenAiQuick.svelte.d.ts +7 -6
- package/package/components/flows/content/ScriptEditorDrawer.svelte +5 -4
- package/package/components/flows/content/SuspendDrawer.svelte +4 -4
- package/package/components/flows/content/SuspendDrawer.svelte.d.ts +4 -18
- package/package/components/flows/flowModuleNextId.d.ts +1 -0
- package/package/components/flows/flowModuleNextId.js +11 -0
- package/package/components/flows/flowStateUtils.svelte.d.ts +1 -1
- package/package/components/flows/header/FlowPreviewButtons.svelte +10 -0
- package/package/components/flows/header/FlowYamlEditor.svelte +6 -2
- package/package/components/flows/map/FlowJobsMenu.svelte +4 -0
- package/package/components/flows/map/FlowJobsMenu.svelte.d.ts +2 -2
- package/package/components/flows/map/FlowModuleSchemaItem.svelte +65 -54
- package/package/components/flows/map/FlowModuleSchemaItem.svelte.d.ts +2 -2
- package/package/components/flows/map/FlowModuleSchemaItemViewer.svelte +11 -9
- package/package/components/flows/map/FlowModuleSchemaItemViewer.svelte.d.ts +1 -0
- package/package/components/flows/map/FlowModuleSchemaMap.svelte +151 -17
- package/package/components/flows/map/FlowModuleSchemaMap.svelte.d.ts +3 -0
- package/package/components/flows/map/InsertModuleInner.svelte +46 -21
- package/package/components/flows/map/MapItem.svelte +22 -9
- package/package/components/flows/map/MapItem.svelte.d.ts +4 -3
- package/package/components/flows/map/VirtualItem.svelte +5 -2
- package/package/components/flows/multiSelectUtils.d.ts +26 -0
- package/package/components/flows/multiSelectUtils.js +122 -0
- package/package/components/flows/pickers/FlowScriptPicker.svelte +3 -0
- package/package/components/flows/pickers/FlowScriptPicker.svelte.d.ts +1 -1
- package/package/components/flows/pickers/FlowScriptPickerQuick.svelte +5 -6
- package/package/components/flows/pickers/FlowScriptPickerQuick.svelte.d.ts +9 -8
- package/package/components/flows/pickers/FlowToplevelNode.svelte +2 -3
- package/package/components/flows/pickers/FlowToplevelNode.svelte.d.ts +6 -5
- package/package/components/flows/pickers/PickHubApp.svelte +21 -2
- package/package/components/flows/pickers/PickHubFlow.svelte +21 -2
- package/package/components/flows/pickers/PickHubScript.svelte +12 -1
- package/package/components/flows/pickers/PickHubScriptQuick.svelte +16 -7
- package/package/components/flows/pickers/TopLevelNode.svelte +2 -0
- package/package/components/flows/previousResults.d.ts +1 -1
- package/package/components/flows/propPicker/JobPickerLight.svelte +1 -1
- package/package/components/flows/propPicker/JobPickerLight.svelte.d.ts +4 -18
- package/package/components/flows/propPicker/OutputBadge.svelte +2 -2
- package/package/components/flows/propPicker/OutputBadge.svelte.d.ts +6 -20
- package/package/components/flows/propPicker/OutputPicker.svelte +1 -0
- package/package/components/flows/propPicker/PropPickerWrapper.svelte +0 -3
- package/package/components/flows/types.d.ts +2 -3
- package/package/components/git_sync/GitSyncContext.svelte.js +74 -41
- package/package/components/git_sync/GitSyncModalManager.svelte +1 -1
- package/package/components/git_sync/GitSyncModalManager.svelte.d.ts +2 -17
- package/package/components/git_sync/GitSyncRepositoryCard.svelte +34 -17
- package/package/components/graph/DragCoordinator.svelte +63 -0
- package/package/components/graph/DragCoordinator.svelte.d.ts +12 -0
- package/package/components/graph/DragGhost.svelte +138 -0
- package/package/components/graph/DragGhost.svelte.d.ts +10 -0
- package/package/components/graph/FlowGraphV2.svelte +85 -61
- package/package/components/graph/FlowGraphV2.svelte.d.ts +9 -3
- package/package/components/graph/MiniFlowGraph.svelte +82 -0
- package/package/components/graph/MiniFlowGraph.svelte.d.ts +11 -0
- package/package/components/graph/MoveHandleButton.svelte +47 -0
- package/package/components/graph/MoveHandleButton.svelte.d.ts +13 -0
- package/package/components/graph/SelectionBoundingBox.svelte +72 -20
- package/package/components/graph/SelectionBoundingBox.svelte.d.ts +7 -0
- package/package/components/graph/SelectionTool.svelte +3 -2
- package/package/components/graph/compoundLayout.d.ts +28 -0
- package/package/components/graph/compoundLayout.js +436 -0
- package/package/components/graph/graphBuilder.svelte.d.ts +9 -22
- package/package/components/graph/graphBuilder.svelte.js +27 -41
- package/package/components/graph/graphContext.d.ts +2 -0
- package/package/components/graph/moveManager.svelte.d.ts +74 -0
- package/package/components/graph/moveManager.svelte.js +176 -0
- package/package/components/graph/noteEditor.svelte.d.ts +0 -1
- package/package/components/graph/noteManager.svelte.d.ts +4 -0
- package/package/components/graph/noteManager.svelte.js +6 -0
- package/package/components/graph/noteUtils.svelte.d.ts +0 -1
- package/package/components/graph/noteUtils.svelte.js +0 -2
- package/package/components/graph/renderers/edges/BaseEdge.svelte +65 -24
- package/package/components/graph/renderers/edges/BaseEdge.svelte.d.ts +0 -1
- package/package/components/graph/renderers/edges/HiddenBaseEdge.svelte +1 -1
- package/package/components/graph/renderers/edges/HiddenBaseEdge.svelte.d.ts +4 -18
- package/package/components/graph/renderers/nodes/AIToolNode.svelte +4 -4
- package/package/components/graph/renderers/nodes/AIToolNode.svelte.d.ts +1 -0
- package/package/components/graph/renderers/nodes/AssetNode.svelte +30 -27
- package/package/components/graph/renderers/nodes/AssetNode.svelte.d.ts +1 -0
- package/package/components/graph/renderers/nodes/AssetsOverflowedNode.svelte +18 -14
- package/package/components/graph/renderers/nodes/AssetsOverflowedNode.svelte.d.ts +1 -0
- package/package/components/graph/renderers/nodes/BranchAllEndNode.svelte +1 -1
- package/package/components/graph/renderers/nodes/BranchAllStart.svelte +1 -1
- package/package/components/graph/renderers/nodes/BranchOneStart.svelte +1 -1
- package/package/components/graph/renderers/nodes/ForLoopEndNode.svelte +1 -1
- package/package/components/graph/renderers/nodes/ForLoopStartNode.svelte +1 -1
- package/package/components/graph/renderers/nodes/ModuleNode.svelte +50 -9
- package/package/components/graph/renderers/nodes/NewAIToolNode.svelte +5 -0
- package/package/components/graph/renderers/nodes/NoBranchNode.svelte +2 -2
- package/package/components/graph/renderers/nodes/NoBranchNode.svelte.d.ts +1 -0
- package/package/components/graph/renderers/nodes/NodeWrapper.svelte +21 -7
- package/package/components/graph/renderers/nodes/NodeWrapper.svelte.d.ts +4 -1
- package/package/components/graph/renderers/nodes/NoteNode.svelte +2 -2
- package/package/components/graph/renderers/nodes/SubflowBound.svelte +1 -1
- package/package/components/graph/renderers/nodes/branchOneEndNode.svelte +1 -1
- package/package/components/graph/renderers/triggers/TriggerButton.svelte +6 -4
- package/package/components/graph/renderers/triggers/TriggerButton.svelte.d.ts +5 -29
- package/package/components/graph/renderers/triggers/TriggerCount.svelte +1 -1
- package/package/components/graph/renderers/triggers/TriggerCount.svelte.d.ts +4 -18
- package/package/components/graph/renderers/triggers/TriggersBadge.svelte +2 -6
- package/package/components/graph/selectionUtils.svelte.d.ts +1 -0
- package/package/components/graph/selectionUtils.svelte.js +11 -1
- package/package/components/graph/util.d.ts +1 -4
- package/package/components/graph/util.js +3 -6
- package/package/components/graph/wacToFlow.d.ts +4 -0
- package/package/components/graph/wacToFlow.js +14 -0
- package/package/components/home/FlowIcon.svelte +2 -2
- package/package/components/home/FlowIcon.svelte.d.ts +5 -19
- package/package/components/home/ItemsList.svelte +3 -3
- package/package/components/home/ListFiltersQuick.svelte +2 -4
- package/package/components/home/ListFiltersQuick.svelte.d.ts +10 -9
- package/package/components/icons/AssetGenericIcon.svelte +3 -1
- package/package/components/icons/ClaudeIcon.svelte +20 -0
- package/package/components/icons/ClaudeIcon.svelte.d.ts +7 -0
- package/package/components/icons/RubyIcon.svelte +2 -2
- package/package/components/icons/WindmillIcon2.svelte +0 -1
- package/package/components/instanceSettings/IndexerMemorySettings.svelte +153 -20
- package/package/components/instanceSettings.js +44 -6
- package/package/components/meltComponents/MeltButton.svelte +5 -10
- package/package/components/meltComponents/MeltButton.svelte.d.ts +12 -35
- package/package/components/meltComponents/Menu.svelte +6 -6
- package/package/components/meltComponents/Menu.svelte.d.ts +2 -2
- package/package/components/meltComponents/Menubar.svelte +3 -2
- package/package/components/meltComponents/Menubar.svelte.d.ts +7 -0
- package/package/components/meltComponents/Popover.svelte +49 -73
- package/package/components/meltComponents/Popover.svelte.d.ts +40 -44
- package/package/components/meltComponents/SideBarTab.svelte +3 -2
- package/package/components/meltComponents/Tooltip.svelte +15 -21
- package/package/components/meltComponents/Tooltip.svelte.d.ts +16 -39
- package/package/components/propertyPicker/ObjectViewer.svelte +253 -165
- package/package/components/propertyPicker/ObjectViewerWrapper.svelte +16 -27
- package/package/components/propertyPicker/ObjectViewerWrapper.svelte.d.ts +16 -15
- package/package/components/propertyPicker/PropPicker.svelte +21 -53
- package/package/components/propertyPicker/PropPicker.svelte.d.ts +0 -1
- package/package/components/propertyPicker/PropPickerResult.svelte +1 -5
- package/package/components/propertyPicker/PropPickerResult.svelte.d.ts +9 -8
- package/package/components/raw_apps/DefaultDatabaseSelector.svelte +40 -36
- package/package/components/raw_apps/FileTreeNode.svelte +2 -2
- package/package/components/raw_apps/RawAppEditorHeader.svelte +14 -1
- package/package/components/raw_apps/RawAppInlineScriptRunnable.svelte +0 -1
- package/package/components/raw_apps/RawAppInputsSpecEditor.svelte +4 -4
- package/package/components/raw_apps/RawAppInputsSpecEditor.svelte.d.ts +0 -1
- package/package/components/raw_apps/RunnableRow.svelte +2 -2
- package/package/components/raw_apps/fileTreeUtils.js +2 -3
- package/package/components/raw_apps/utils.js +6 -1
- package/package/components/recording/FlowRecordingReplay.svelte +210 -0
- package/package/components/recording/FlowRecordingReplay.svelte.d.ts +7 -0
- package/package/components/recording/ScriptRecordingReplay.svelte +210 -0
- package/package/components/recording/ScriptRecordingReplay.svelte.d.ts +7 -0
- package/package/components/recording/flowRecording.svelte.d.ts +22 -0
- package/package/components/recording/flowRecording.svelte.js +205 -0
- package/package/components/recording/scriptRecording.svelte.d.ts +9 -0
- package/package/components/recording/scriptRecording.svelte.js +88 -0
- package/package/components/recording/types.d.ts +39 -0
- package/package/components/recording/types.js +1 -0
- package/package/components/resources/resourcesFilter.d.ts +4 -0
- package/package/components/resources/resourcesFilter.js +4 -0
- package/package/components/runs/JobRunsPreview.svelte +8 -1
- package/package/components/runs/MobileFilters.svelte +15 -10
- package/package/components/runs/MobileFilters.svelte.d.ts +4 -18
- package/package/components/runs/PreprocessedArgsDisplay.svelte +2 -10
- package/package/components/runs/PreprocessedArgsDisplay.svelte.d.ts +4 -18
- package/package/components/runs/QueuePopover.svelte +2 -2
- package/package/components/runs/QueuePopover.svelte.d.ts +4 -18
- package/package/components/runs/RunBadges.svelte +1 -1
- package/package/components/runs/RunsTable.svelte +9 -4
- package/package/components/runs/RunsTable.svelte.d.ts +1 -0
- package/package/components/runs/runsFilter.d.ts +18 -2
- package/package/components/runs/runsFilter.js +20 -4
- package/package/components/runs/useJobsLoader.svelte.d.ts +8 -1
- package/package/components/runs/useJobsLoader.svelte.js +189 -47
- package/package/components/schedules/schedulesFilter.d.ts +4 -0
- package/package/components/schedules/schedulesFilter.js +4 -0
- package/package/components/schema/AddProperty.svelte +1 -1
- package/package/components/schema/AddProperty.svelte.d.ts +5 -6
- package/package/components/schema/AddPropertyForm.svelte +1 -1
- package/package/components/schema/AddPropertyForm.svelte.d.ts +1 -1
- package/package/components/schema/EditableSchemaSdkWrapper.svelte +3 -2
- package/package/components/schema/FlowPropertyEditor.svelte +1 -5
- package/package/components/schema/RunningJobSchemaPicker.svelte +31 -30
- package/package/components/schema/RunningJobSchemaPicker.svelte.d.ts +8 -7
- package/package/components/schema/SchemaPickerRow.svelte +3 -3
- package/package/components/scriptEditor/LogPanel.svelte +11 -2
- package/package/components/script_builder.d.ts +1 -1
- package/package/components/search/QuickMenuItem.svelte +2 -2
- package/package/components/search/RunsSearch.svelte +5 -1
- package/package/components/select/GenericDropdown.svelte +5 -2
- package/package/components/select/MultiSelect.svelte +1 -0
- package/package/components/select/Select.svelte +1 -0
- package/package/components/select/SelectDropdown.svelte +1 -1
- package/package/components/settings/ChangeWorkspaceId.svelte +14 -9
- package/package/components/settings/ChangeWorkspaceId.svelte.d.ts +4 -18
- package/package/components/settings/CreateToken.svelte +8 -20
- package/package/components/settings/PremiumInfo.svelte +36 -32
- package/package/components/settings/PremiumInfo.svelte.d.ts +4 -18
- package/package/components/settings/TokensTable.svelte +74 -14
- package/package/components/settings/WorkspaceUserSettings.svelte +0 -1
- package/package/components/sidebar/CriticalAlertModal.svelte +33 -30
- package/package/components/sidebar/CriticalAlertModal.svelte.d.ts +4 -18
- package/package/components/sidebar/CriticalAlertTable.svelte +4 -13
- package/package/components/sidebar/CriticalAlertTable.svelte.d.ts +4 -18
- package/package/components/sidebar/DarkModeToggle.svelte +2 -3
- package/package/components/sidebar/DarkModeToggle.svelte.d.ts +5 -20
- package/package/components/sidebar/FavoriteMenu.svelte +1 -1
- package/package/components/sidebar/MenuButton.svelte +2 -2
- package/package/components/sidebar/MultiplayerMenu.svelte +12 -7
- package/package/components/sidebar/MultiplayerMenu.svelte.d.ts +2 -17
- package/package/components/sidebar/SideBarNotification.svelte +1 -2
- package/package/components/sidebar/SideBarNotification.svelte.d.ts +4 -18
- package/package/components/sidebar/SidebarContent.svelte +3 -3
- package/package/components/sidebar/WorkspaceMenu.svelte +4 -4
- package/package/components/splitPanes/AnimatedPane.svelte +2 -2
- package/package/components/splitPanes/SplitPanesWrapper.svelte +11 -15
- package/package/components/splitPanes/SplitPanesWrapper.svelte.d.ts +12 -28
- package/package/components/sqlTypeService.d.ts +2 -2
- package/package/components/sqlTypeService.js +4 -8
- package/package/components/table/Cell.svelte +2 -2
- package/package/components/table/DataTable.svelte +1 -1
- package/package/components/table/DownloadCsv.svelte +1 -2
- package/package/components/table/DownloadCsv.svelte.d.ts +4 -18
- package/package/components/table/Head.svelte +6 -2
- package/package/components/table/Head.svelte.d.ts +6 -27
- package/package/components/table/Row.svelte +6 -10
- package/package/components/table/Row.svelte.d.ts +11 -18
- package/package/components/triggers/CaptureIcon.svelte +1 -2
- package/package/components/triggers/CaptureIcon.svelte.d.ts +5 -19
- package/package/components/triggers/TestTriggerConnection.svelte +1 -4
- package/package/components/triggers/TestTriggerConnection.svelte.d.ts +6 -21
- package/package/components/triggers/TriggerAdvancedBadges.svelte +16 -0
- package/package/components/triggers/TriggerAdvancedBadges.svelte.d.ts +12 -0
- package/package/components/triggers/TriggerEditorToolbar.svelte +11 -9
- package/package/components/triggers/TriggerTokens.svelte +8 -7
- package/package/components/triggers/TriggerTokens.svelte.d.ts +6 -21
- package/package/components/triggers/email/EmailTriggerEditorConfigSection.svelte +1 -1
- package/package/components/triggers/email/EmailTriggerEditorInner.svelte +7 -2
- package/package/components/triggers/gcp/GcpTriggerEditorInner.svelte +9 -2
- package/package/components/triggers/http/RouteCapture.svelte +1 -1
- package/package/components/triggers/http/RouteEditorConfigSection.svelte +1 -1
- package/package/components/triggers/http/RouteEditorInner.svelte +10 -1
- package/package/components/triggers/kafka/KafkaTriggerEditorInner.svelte +119 -5
- package/package/components/triggers/kafka/KafkaTriggersConfigSection.svelte +1 -0
- package/package/components/triggers/kafka/utils.js +2 -0
- package/package/components/triggers/mqtt/MqttTriggerEditorInner.svelte +12 -3
- package/package/components/triggers/native/services/google/GoogleDrivePicker.svelte.d.ts +1 -1
- package/package/components/triggers/nats/NatsTriggerEditorInner.svelte +7 -2
- package/package/components/triggers/postgres/CheckPostgresRequirement.svelte +2 -4
- package/package/components/triggers/postgres/CheckPostgresRequirement.svelte.d.ts +4 -18
- package/package/components/triggers/postgres/PostgresTriggerEditorInner.svelte +10 -4
- package/package/components/triggers/postgres/PublicationPicker.svelte +9 -12
- package/package/components/triggers/postgres/PublicationPicker.svelte.d.ts +4 -18
- package/package/components/triggers/postgres/SlotPicker.svelte +4 -7
- package/package/components/triggers/postgres/SlotPicker.svelte.d.ts +4 -18
- package/package/components/triggers/schedules/ScheduleEditorInner.svelte +10 -0
- package/package/components/triggers/sqs/SqsTriggerEditorInner.svelte +6 -1
- package/package/components/triggers/testingBadge.svelte +3 -1
- package/package/components/triggers/webhook/WebhooksConfigSection.svelte +1 -1
- package/package/components/triggers/websocket/WebsocketCapture.svelte +15 -13
- package/package/components/triggers/websocket/WebsocketTriggerEditorInner.svelte +10 -4
- package/package/components/tutorials/Tutorial.svelte +2 -6
- package/package/components/tutorials/Tutorial.svelte.d.ts +14 -23
- package/package/components/tutorials/TutorialControls.svelte +1 -2
- package/package/components/tutorials/TutorialControls.svelte.d.ts +6 -5
- package/package/components/tutorials/TutorialWrapper.svelte +3 -2
- package/package/components/tutorials/app/BackgroundRunnablesTutorial.svelte +2 -3
- package/package/components/tutorials/app/BackgroundRunnablesTutorial.svelte.d.ts +6 -6
- package/package/components/tutorials/app/ConnectionTutorial.svelte +2 -3
- package/package/components/tutorials/app/ConnectionTutorial.svelte.d.ts +6 -6
- package/package/components/tutorials/app/ExpressionEvaluationTutorial.svelte +2 -3
- package/package/components/tutorials/app/ExpressionEvaluationTutorial.svelte.d.ts +6 -6
- package/package/components/tutorials/workspace/WorkspaceOnboardingOperatorTutorial.svelte +3 -3
- package/package/components/tutorials/workspace/WorkspaceOnboardingTutorial.svelte +3 -3
- package/package/components/variables/variablesFilter.d.ts +4 -0
- package/package/components/variables/variablesFilter.js +4 -0
- package/package/components/wizards/AppPicker.svelte +3 -3
- package/package/components/wizards/AppPicker.svelte.d.ts +4 -18
- package/package/components/wizards/DBExplorerWizard.svelte +1 -0
- package/package/components/workspace/WorkspaceCard.svelte +3 -2
- package/package/components/workspaceSettings/CreateWorkspace.svelte +3 -3
- package/package/components/workspaceSettings/CustomInstanceDbSelect.svelte +1 -3
- package/package/components/workspaceSettings/CustomInstanceDbSelect.svelte.d.ts +0 -2
- package/package/components/workspaceSettings/CustomInstanceDbWizardModal.svelte +3 -3
- package/package/components/workspaceSettings/CustomInstanceDbWizardModal.svelte.d.ts +0 -1
- package/package/components/workspaceSettings/DataTableSettings.svelte +7 -12
- package/package/components/workspaceSettings/DucklakeSettings.svelte +131 -167
- package/package/components/workspaceSettings/GitSyncFilterSettings.svelte +12 -2
- package/package/components/workspaceSettings/RulesetEditor.svelte +24 -12
- package/package/components/workspaceSettings/StorageSettings.svelte +68 -15
- package/package/components/workspaceSettings/WorkspaceIntegrations.svelte +10 -9
- package/package/gen/core/OpenAPI.js +1 -1
- package/package/gen/schemas.gen.d.ts +257 -9
- package/package/gen/schemas.gen.js +257 -9
- package/package/gen/services.gen.d.ts +165 -58
- package/package/gen/services.gen.js +278 -64
- package/package/gen/types.gen.d.ts +779 -128
- package/package/hub.d.ts +0 -1
- package/package/hubPaths.json +24 -22
- package/package/infer.js +64 -14
- package/package/infer.svelte.js +88 -42
- package/package/script_helpers.d.ts +8 -5
- package/package/script_helpers.js +64 -21
- package/package/stores.d.ts +3 -1
- package/package/stores.js +2 -3
- package/package/svelte5Utils.svelte.js +6 -0
- package/package/svelte5UtilsKit.svelte.js +3 -2
- package/package/system_prompts/prompts.d.ts +20 -20
- package/package/system_prompts/prompts.js +814 -540
- package/package/templates/claude_sandbox.ts.template +85 -0
- package/package/utils/editInFork.d.ts +3 -0
- package/package/utils/editInFork.js +19 -0
- package/package/utils.js +2 -2
- package/package/utils_deployable.d.ts +233 -9
- package/package/utils_deployable.js +64 -10
- package/package/utils_workspace_deploy.d.ts +31 -0
- package/package/utils_workspace_deploy.js +449 -0
- package/package/workspace_settings.d.ts +2 -1
- package/package/workspace_settings.js +28 -0
- package/package.json +34 -15
- package/dist/sharedUtils/components/assets/lib.d.ts +0 -25
- package/dist/sharedUtils/components/icons/index.d.ts +0 -101
- package/package/svelte5Utils.svelte.d.ts +0 -178
|
@@ -33,10 +33,12 @@ export const FLOW_BASE = `# Windmill Flow Building Guide
|
|
|
33
33
|
|
|
34
34
|
Create a folder ending with \`.flow\` and add a YAML file with the flow definition.
|
|
35
35
|
For rawscript modules, use \`!inline path/to/script.ts\` for the content key.
|
|
36
|
-
After writing:
|
|
37
|
-
- \`wmill flow generate-locks --yes\` - Generate lock files
|
|
36
|
+
After writing, tell the user they can run:
|
|
37
|
+
- \`wmill flow generate-locks <path_to_flow_folder> --yes\` - Generate lock files for the specific flow you modified (e.g. \`wmill flow generate-locks f/my_folder/my_flow.flow --yes\`)
|
|
38
38
|
- \`wmill sync push\` - Deploy to Windmill
|
|
39
39
|
|
|
40
|
+
Do NOT run these commands yourself. Instead, inform the user that they should run them.
|
|
41
|
+
|
|
40
42
|
## OpenFlow Schema
|
|
41
43
|
|
|
42
44
|
The OpenFlow schema (openflow.openapi.yaml) is the source of truth for flow structure. Refer to OPENFLOW_SCHEMA for the complete type definitions.
|
|
@@ -242,13 +244,6 @@ async getResult(jobId: string): Promise<any>
|
|
|
242
244
|
*/
|
|
243
245
|
async getResultMaybe(jobId: string): Promise<any>
|
|
244
246
|
|
|
245
|
-
/**
|
|
246
|
-
* Wrap a function to execute as a Windmill task within a flow context
|
|
247
|
-
* @param f - Function to wrap as a task
|
|
248
|
-
* @returns Async wrapper function that executes as a Windmill job
|
|
249
|
-
*/
|
|
250
|
-
task<P, T>(f: (_: P) => T): (_: P) => Promise<T>
|
|
251
|
-
|
|
252
247
|
/**
|
|
253
248
|
* @deprecated Use runScriptByPathAsync or runScriptByHashAsync instead
|
|
254
249
|
*/
|
|
@@ -520,6 +515,8 @@ async usernameToEmail(username: string): Promise<string>
|
|
|
520
515
|
* @param {string} [options.approver] - Optional user ID or name of the approver for the request.
|
|
521
516
|
* @param {DefaultArgs} [options.defaultArgsJson] - Optional object defining or overriding the default arguments to a form field.
|
|
522
517
|
* @param {Enums} [options.dynamicEnumsJson] - Optional object overriding the enum default values of an enum form field.
|
|
518
|
+
* @param {string} [options.resumeButtonText] - Optional text for the resume button.
|
|
519
|
+
* @param {string} [options.cancelButtonText] - Optional text for the cancel button.
|
|
523
520
|
*
|
|
524
521
|
* @returns {Promise<void>} Resolves when the Slack approval request is successfully sent.
|
|
525
522
|
*
|
|
@@ -535,12 +532,14 @@ async usernameToEmail(username: string): Promise<string>
|
|
|
535
532
|
* approver: "approver123",
|
|
536
533
|
* defaultArgsJson: { key1: "value1", key2: 42 },
|
|
537
534
|
* dynamicEnumsJson: { foo: ["choice1", "choice2"], bar: ["optionA", "optionB"] },
|
|
535
|
+
* resumeButtonText: "Resume",
|
|
536
|
+
* cancelButtonText: "Cancel",
|
|
538
537
|
* });
|
|
539
538
|
* \`\`\`
|
|
540
539
|
*
|
|
541
540
|
* **Note:** This function requires execution within a Windmill flow or flow preview.
|
|
542
541
|
*/
|
|
543
|
-
async requestInteractiveSlackApproval({ slackResourcePath, channelId, message, approver, defaultArgsJson, dynamicEnumsJson, }: SlackApprovalOptions): Promise<void>
|
|
542
|
+
async requestInteractiveSlackApproval({ slackResourcePath, channelId, message, approver, defaultArgsJson, dynamicEnumsJson, resumeButtonText, cancelButtonText, }: SlackApprovalOptions): Promise<void>
|
|
544
543
|
|
|
545
544
|
/**
|
|
546
545
|
* Sends an interactive approval request via Teams, allowing optional customization of the message, approver, and form fields.
|
|
@@ -584,6 +583,75 @@ async requestInteractiveTeamsApproval({ teamName, channelName, message, approver
|
|
|
584
583
|
*/
|
|
585
584
|
parseS3Object(s3Object: S3Object): S3ObjectRecord
|
|
586
585
|
|
|
586
|
+
setWorkflowCtx(ctx: WorkflowCtx | null): void
|
|
587
|
+
|
|
588
|
+
async sleep(seconds: number): Promise<void>
|
|
589
|
+
|
|
590
|
+
async step<T>(name: string, fn: () => T | Promise<T>): Promise<T>
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* Create a task that dispatches to a separate Windmill script.
|
|
594
|
+
*
|
|
595
|
+
* @example
|
|
596
|
+
* const extract = taskScript("f/data/extract");
|
|
597
|
+
* // inside workflow: await extract({ url: "https://..." })
|
|
598
|
+
*/
|
|
599
|
+
taskScript(path: string, options?: TaskOptions): (...args: any[]) => PromiseLike<any>
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Create a task that dispatches to a separate Windmill flow.
|
|
603
|
+
*
|
|
604
|
+
* @example
|
|
605
|
+
* const pipeline = taskFlow("f/etl/pipeline");
|
|
606
|
+
* // inside workflow: await pipeline({ input: data })
|
|
607
|
+
*/
|
|
608
|
+
taskFlow(path: string, options?: TaskOptions): (...args: any[]) => PromiseLike<any>
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* Mark an async function as a workflow-as-code entry point.
|
|
612
|
+
*
|
|
613
|
+
* The function must be **deterministic**: given the same inputs it must call
|
|
614
|
+
* tasks in the same order on every replay. Branching on task results is fine
|
|
615
|
+
* (results are replayed from checkpoint), but branching on external state
|
|
616
|
+
* (current time, random values, external API calls) must use \`step()\` to
|
|
617
|
+
* checkpoint the value so replays see the same result.
|
|
618
|
+
*/
|
|
619
|
+
workflow<T>(fn: (...args: any[]) => Promise<T>): void
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
* Suspend the workflow and wait for an external approval.
|
|
623
|
+
*
|
|
624
|
+
* Use \`getResumeUrls()\` (wrapped in \`step()\`) to obtain resume/cancel/approvalPage
|
|
625
|
+
* URLs before calling this function.
|
|
626
|
+
*
|
|
627
|
+
* @example
|
|
628
|
+
* const urls = await step("urls", () => getResumeUrls());
|
|
629
|
+
* await step("notify", () => sendEmail(urls.approvalPage));
|
|
630
|
+
* const { value, approver } = await waitForApproval({ timeout: 3600 });
|
|
631
|
+
*/
|
|
632
|
+
waitForApproval(options?: { timeout?: number; form?: object; }): PromiseLike<{ value: any; approver: string; approved: boolean }>
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* Process items in parallel with optional concurrency control.
|
|
636
|
+
*
|
|
637
|
+
* Each item is processed by calling \`fn(item)\`, which should be a task().
|
|
638
|
+
* Items are dispatched in batches of \`concurrency\` (default: all at once).
|
|
639
|
+
*
|
|
640
|
+
* @example
|
|
641
|
+
* const process = task(async (item: string) => { ... });
|
|
642
|
+
* const results = await parallel(items, process, { concurrency: 5 });
|
|
643
|
+
*/
|
|
644
|
+
async parallel<T, R>(items: T[], fn: (item: T) => PromiseLike<R> | R, options?: { concurrency?: number },): Promise<R[]>
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Commit Kafka offsets for a trigger with auto_commit disabled.
|
|
648
|
+
* @param triggerPath - Path to the Kafka trigger (from event.wm_trigger.trigger_path)
|
|
649
|
+
* @param topic - Kafka topic name (from event.topic)
|
|
650
|
+
* @param partition - Partition number (from event.partition)
|
|
651
|
+
* @param offset - Message offset to commit (from event.offset)
|
|
652
|
+
*/
|
|
653
|
+
async commitKafkaOffsets(triggerPath: string, topic: string, partition: number, offset: number,): Promise<void>
|
|
654
|
+
|
|
587
655
|
/**
|
|
588
656
|
* Create a SQL template function for PostgreSQL/datatable queries
|
|
589
657
|
* @param name - Database/datatable name (default: "main")
|
|
@@ -904,6 +972,16 @@ def load_s3_file_reader(s3object: S3Object | str, s3_resource_path: str | None)
|
|
|
904
972
|
# '''
|
|
905
973
|
def write_s3_file(s3object: S3Object | str | None, file_content: BufferedReader | bytes, s3_resource_path: str | None, content_type: str | None = None, content_disposition: str | None = None) -> S3Object
|
|
906
974
|
|
|
975
|
+
# Permanently delete a file from the workspace S3 bucket.
|
|
976
|
+
#
|
|
977
|
+
# '''python
|
|
978
|
+
# from wmill import S3Object
|
|
979
|
+
#
|
|
980
|
+
# s3_obj = S3Object(s3="/path/to/my_file.txt")
|
|
981
|
+
# client.delete_s3_object(s3_obj)
|
|
982
|
+
# '''
|
|
983
|
+
def delete_s3_object(s3object: S3Object | str, s3_resource_path: str | None = None) -> None
|
|
984
|
+
|
|
907
985
|
# Sign S3 objects for use by anonymous users in public apps.
|
|
908
986
|
#
|
|
909
987
|
# Args:
|
|
@@ -1122,18 +1200,6 @@ def boto3_connection_settings(s3_resource_path: str = '') -> Boto3ConnectionSett
|
|
|
1122
1200
|
# State path string
|
|
1123
1201
|
def get_state_path() -> str
|
|
1124
1202
|
|
|
1125
|
-
# Decorator to mark a function as a workflow task.
|
|
1126
|
-
#
|
|
1127
|
-
# When executed inside a Windmill job, the decorated function runs as a
|
|
1128
|
-
# separate workflow step. Outside Windmill, it executes normally.
|
|
1129
|
-
#
|
|
1130
|
-
# Args:
|
|
1131
|
-
# tag: Optional worker tag for execution
|
|
1132
|
-
#
|
|
1133
|
-
# Returns:
|
|
1134
|
-
# Decorated function
|
|
1135
|
-
def task(*args, **kwargs)
|
|
1136
|
-
|
|
1137
1203
|
# Parse resource syntax from string.
|
|
1138
1204
|
def parse_resource_syntax(s: str) -> Optional[str]
|
|
1139
1205
|
|
|
@@ -1197,16 +1263,113 @@ def infer_sql_type(value) -> str
|
|
|
1197
1263
|
|
|
1198
1264
|
def parse_sql_client_name(name: str) -> tuple[str, Optional[str]]
|
|
1199
1265
|
|
|
1266
|
+
# Decorator that marks a function as a workflow task.
|
|
1267
|
+
#
|
|
1268
|
+
# Works in both WAC v1 (sync, HTTP-based dispatch) and WAC v2
|
|
1269
|
+
# (async, checkpoint/replay) modes:
|
|
1270
|
+
#
|
|
1271
|
+
# - **v2 (inside @workflow)**: dispatches as a checkpoint step.
|
|
1272
|
+
# - **v1 (WM_JOB_ID set, no @workflow)**: dispatches via HTTP API.
|
|
1273
|
+
# - **Standalone**: executes the function body directly.
|
|
1274
|
+
#
|
|
1275
|
+
# Usage::
|
|
1276
|
+
#
|
|
1277
|
+
# @task
|
|
1278
|
+
# async def extract_data(url: str): ...
|
|
1279
|
+
#
|
|
1280
|
+
# @task(path="f/external_script", timeout=600, tag="gpu")
|
|
1281
|
+
# async def run_external(x: int): ...
|
|
1282
|
+
def task(_func = None, path: Optional[str] = None, tag: Optional[str] = None, timeout: Optional[int] = None, cache_ttl: Optional[int] = None, priority: Optional[int] = None, concurrency_limit: Optional[int] = None, concurrency_key: Optional[str] = None, concurrency_time_window_s: Optional[int] = None)
|
|
1283
|
+
|
|
1284
|
+
# Create a task that dispatches to a separate Windmill script.
|
|
1285
|
+
#
|
|
1286
|
+
# Usage::
|
|
1287
|
+
#
|
|
1288
|
+
# extract = task_script("f/data/extract", timeout=600)
|
|
1289
|
+
#
|
|
1290
|
+
# @workflow
|
|
1291
|
+
# async def main():
|
|
1292
|
+
# data = await extract(url="https://...")
|
|
1293
|
+
def task_script(path: str, timeout: Optional[int] = None, tag: Optional[str] = None, cache_ttl: Optional[int] = None, priority: Optional[int] = None, concurrency_limit: Optional[int] = None, concurrency_key: Optional[str] = None, concurrency_time_window_s: Optional[int] = None)
|
|
1294
|
+
|
|
1295
|
+
# Create a task that dispatches to a separate Windmill flow.
|
|
1296
|
+
#
|
|
1297
|
+
# Usage::
|
|
1298
|
+
#
|
|
1299
|
+
# pipeline = task_flow("f/etl/pipeline", priority=10)
|
|
1300
|
+
#
|
|
1301
|
+
# @workflow
|
|
1302
|
+
# async def main():
|
|
1303
|
+
# result = await pipeline(input=data)
|
|
1304
|
+
def task_flow(path: str, timeout: Optional[int] = None, tag: Optional[str] = None, cache_ttl: Optional[int] = None, priority: Optional[int] = None, concurrency_limit: Optional[int] = None, concurrency_key: Optional[str] = None, concurrency_time_window_s: Optional[int] = None)
|
|
1305
|
+
|
|
1306
|
+
# Decorator marking an async function as a workflow-as-code entry point.
|
|
1307
|
+
#
|
|
1308
|
+
# The function must be **deterministic**: given the same inputs it must call
|
|
1309
|
+
# tasks in the same order on every replay. Branching on task results is fine
|
|
1310
|
+
# (results are replayed from checkpoint), but branching on external state
|
|
1311
|
+
# (current time, random values, external API calls) must use \`\`step()\`\` to
|
|
1312
|
+
# checkpoint the value so replays see the same result.
|
|
1313
|
+
def workflow(func)
|
|
1314
|
+
|
|
1315
|
+
# Execute \`\`fn\`\` inline and checkpoint the result.
|
|
1316
|
+
#
|
|
1317
|
+
# On replay the cached value is returned without re-executing \`\`fn\`\`.
|
|
1318
|
+
# Use for lightweight deterministic operations (timestamps, random IDs,
|
|
1319
|
+
# config reads) that should not incur the overhead of a child job.
|
|
1320
|
+
async def step(name: str, fn)
|
|
1321
|
+
|
|
1322
|
+
# Server-side sleep — suspend the workflow for the given duration without holding a worker.
|
|
1323
|
+
#
|
|
1324
|
+
# Inside a @workflow, the parent job suspends and auto-resumes after \`\`seconds\`\`.
|
|
1325
|
+
# Outside a workflow, falls back to \`\`asyncio.sleep\`\`.
|
|
1326
|
+
async def sleep(seconds: int)
|
|
1327
|
+
|
|
1328
|
+
# Suspend the workflow and wait for an external approval.
|
|
1329
|
+
#
|
|
1330
|
+
# Use \`\`get_resume_urls()\`\` (wrapped in \`\`step()\`\`) to obtain
|
|
1331
|
+
# resume/cancel/approval URLs before calling this function.
|
|
1332
|
+
#
|
|
1333
|
+
# Returns a dict with \`\`value\`\` (form data), \`\`approver\`\`, and \`\`approved\`\`.
|
|
1334
|
+
#
|
|
1335
|
+
# Example::
|
|
1336
|
+
#
|
|
1337
|
+
# urls = await step("urls", lambda: get_resume_urls())
|
|
1338
|
+
# await step("notify", lambda: send_email(urls["approvalPage"]))
|
|
1339
|
+
# result = await wait_for_approval(timeout=3600)
|
|
1340
|
+
async def wait_for_approval(timeout: int = 1800, form: dict | None = None) -> dict
|
|
1341
|
+
|
|
1342
|
+
# Process items in parallel with optional concurrency control.
|
|
1343
|
+
#
|
|
1344
|
+
# Each item is processed by calling \`\`fn(item)\`\`, which should be a @task.
|
|
1345
|
+
# Items are dispatched in batches of \`\`concurrency\`\` (default: all at once).
|
|
1346
|
+
#
|
|
1347
|
+
# Example::
|
|
1348
|
+
#
|
|
1349
|
+
# @task
|
|
1350
|
+
# async def process(item: str):
|
|
1351
|
+
# ...
|
|
1352
|
+
#
|
|
1353
|
+
# results = await parallel(items, process, concurrency=5)
|
|
1354
|
+
async def parallel(items, fn, concurrency: Optional[int] = None)
|
|
1355
|
+
|
|
1356
|
+
# Commit Kafka offsets for a trigger with auto_commit disabled.
|
|
1357
|
+
#
|
|
1358
|
+
# Args:
|
|
1359
|
+
# trigger_path: Path to the Kafka trigger (from event['wm_trigger']['trigger_path'])
|
|
1360
|
+
# topic: Kafka topic name (from event['topic'])
|
|
1361
|
+
# partition: Partition number (from event['partition'])
|
|
1362
|
+
# offset: Message offset to commit (from event['offset'])
|
|
1363
|
+
def commit_kafka_offsets(trigger_path: str, topic: str, partition: int, offset: int) -> None
|
|
1364
|
+
|
|
1200
1365
|
`;
|
|
1201
1366
|
export const OPENFLOW_SCHEMA = `## OpenFlow Schema
|
|
1202
1367
|
|
|
1203
|
-
{"OpenFlow":{"type":"object","description":"Top-level flow definition containing metadata, configuration, and the flow structure","properties":{"summary":{"type":"string","description":"Short description of what this flow does"},"description":{"type":"string","description":"Detailed documentation for this flow"},"value":{"$ref":"#/components/schemas/FlowValue"},"schema":{"type":"object","description":"JSON Schema for flow inputs. Use this to define input parameters, their types, defaults, and validation. For resource inputs, set type to 'object' and format to 'resource-<type>' (e.g., 'resource-stripe')"}},"required":["summary","value"]},"FlowValue":{"type":"object","description":"The flow structure containing modules and optional preprocessor/failure handlers","properties":{"modules":{"type":"array","description":"Array of steps that execute in sequence. Each step can be a script, subflow, loop, or branch","items":{"$ref":"#/components/schemas/FlowModule"}},"failure_module":{"description":"Special module that executes when the flow fails. Receives error object with message, name, stack, and step_id. Must have id 'failure'. Only supports script/rawscript types","$ref":"#/components/schemas/FlowModule"},"preprocessor_module":{"description":"Special module that runs before the first step on external triggers. Must have id 'preprocessor'. Only supports script/rawscript types. Cannot reference other step results","$ref":"#/components/schemas/FlowModule"},"same_worker":{"type":"boolean","description":"If true, all steps run on the same worker for better performance"},"concurrent_limit":{"type":"number","description":"Maximum number of concurrent executions of this flow"},"concurrency_key":{"type":"string","description":"Expression to group concurrent executions (e.g., by user ID)"},"concurrency_time_window_s":{"type":"number","description":"Time window in seconds for concurrent_limit"},"debounce_delay_s":{"type":"number","description":"Delay in seconds to debounce flow executions"},"debounce_key":{"type":"string","description":"Expression to group debounced executions"},"debounce_args_to_accumulate":{"type":"array","description":"Arguments to accumulate across debounced executions","items":{"type":"string"}},"max_total_debouncing_time":{"type":"number","description":"Maximum total time in seconds that a job can be debounced"},"max_total_debounces_amount":{"type":"number","description":"Maximum number of times a job can be debounced"},"skip_expr":{"type":"string","description":"JavaScript expression to conditionally skip the entire flow"},"cache_ttl":{"type":"number","description":"Cache duration in seconds for flow results"},"cache_ignore_s3_path":{"type":"boolean"},"flow_env":{"type":"object","description":"Environment variables available to all steps","additionalProperties":{"type":"string"}},"priority":{"type":"number","description":"Execution priority (higher numbers run first)"},"early_return":{"type":"string","description":"JavaScript expression to return early from the flow"},"chat_input_enabled":{"type":"boolean","description":"Whether this flow accepts chat-style input"},"notes":{"type":"array","description":"Sticky notes attached to the flow","items":{"$ref":"#/components/schemas/FlowNote"}}},"required":["modules"]},"Retry":{"type":"object","description":"Retry configuration for failed module executions","properties":{"constant":{"type":"object","description":"Retry with constant delay between attempts","properties":{"attempts":{"type":"integer","description":"Number of retry attempts"},"seconds":{"type":"integer","description":"Seconds to wait between retries"}}},"exponential":{"type":"object","description":"Retry with exponential backoff (delay doubles each time)","properties":{"attempts":{"type":"integer","description":"Number of retry attempts"},"multiplier":{"type":"integer","description":"Multiplier for exponential backoff"},"seconds":{"type":"integer","minimum":1,"description":"Initial delay in seconds"},"random_factor":{"type":"integer","minimum":0,"maximum":100,"description":"Random jitter percentage (0-100) to avoid thundering herd"}}},"retry_if":{"$ref":"#/components/schemas/RetryIf"}}},"FlowNote":{"type":"object","description":"A sticky note attached to a flow for documentation and annotation","properties":{"id":{"type":"string","description":"Unique identifier for the note"},"text":{"type":"string","description":"Content of the note"},"position":{"type":"object","description":"Position of the note in the flow editor","properties":{"x":{"type":"number","description":"X coordinate"},"y":{"type":"number","description":"Y coordinate"}},"required":["x","y"]},"size":{"type":"object","description":"Size of the note in the flow editor","properties":{"width":{"type":"number","description":"Width in pixels"},"height":{"type":"number","description":"Height in pixels"}},"required":["width","height"]},"color":{"type":"string","description":"Color of the note (e.g., \\"yellow\\", \\"#ffff00\\")"},"type":{"type":"string","enum":["free","group"],"description":"Type of note - 'free' for standalone notes, 'group' for notes that group other nodes"},"locked":{"type":"boolean","default":false,"description":"Whether the note is locked and cannot be edited or moved"},"contained_node_ids":{"type":"array","items":{"type":"string"},"description":"For group notes, the IDs of nodes contained within this group"}},"required":["id","text","color","type"]},"RetryIf":{"type":"object","description":"Conditional retry based on error or result","properties":{"expr":{"type":"string","description":"JavaScript expression that returns true to retry. Has access to 'result' and 'error' variables"}},"required":["expr"]},"StopAfterIf":{"type":"object","description":"Early termination condition for a module","properties":{"skip_if_stopped":{"type":"boolean","description":"If true, following steps are skipped when this condition triggers"},"expr":{"type":"string","description":"JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"},"error_message":{"type":"string","description":"Custom error message shown when stopping"}},"required":["expr"]},"FlowModule":{"type":"object","description":"A single step in a flow. Can be a script, subflow, loop, or branch","properties":{"id":{"type":"string","description":"Unique identifier for this step. Used to reference results via 'results.step_id'. Must be a valid identifier (alphanumeric, underscore, hyphen)"},"value":{"$ref":"#/components/schemas/FlowModuleValue"},"stop_after_if":{"description":"Early termination condition evaluated after this step completes","$ref":"#/components/schemas/StopAfterIf"},"stop_after_all_iters_if":{"description":"For loops only - early termination condition evaluated after all iterations complete","$ref":"#/components/schemas/StopAfterIf"},"skip_if":{"type":"object","description":"Conditionally skip this step based on previous results or flow inputs","properties":{"expr":{"type":"string","description":"JavaScript expression that returns true to skip. Can use 'flow_input' or 'results.<step_id>'"}},"required":["expr"]},"sleep":{"description":"Delay before executing this step (in seconds or as expression)","$ref":"#/components/schemas/InputTransform"},"cache_ttl":{"type":"number","description":"Cache duration in seconds for this step's results"},"cache_ignore_s3_path":{"type":"boolean"},"timeout":{"description":"Maximum execution time in seconds (static value or expression)","$ref":"#/components/schemas/InputTransform"},"delete_after_use":{"type":"boolean","description":"If true, this step's result is deleted after use to save memory"},"summary":{"type":"string","description":"Short description of what this step does"},"mock":{"type":"object","description":"Mock configuration for testing without executing the actual step","properties":{"enabled":{"type":"boolean","description":"If true, return mock value instead of executing"},"return_value":{"description":"Value to return when mocked"}}},"suspend":{"type":"object","description":"Configuration for approval/resume steps that wait for user input","properties":{"required_events":{"type":"integer","description":"Number of approvals required before continuing"},"timeout":{"type":"integer","description":"Timeout in seconds before auto-continuing or canceling"},"resume_form":{"type":"object","description":"Form schema for collecting input when resuming","properties":{"schema":{"type":"object","description":"JSON Schema for the resume form"}}},"user_auth_required":{"type":"boolean","description":"If true, only authenticated users can approve"},"user_groups_required":{"description":"Expression or list of groups that can approve","$ref":"#/components/schemas/InputTransform"},"self_approval_disabled":{"type":"boolean","description":"If true, the user who started the flow cannot approve"},"hide_cancel":{"type":"boolean","description":"If true, hide the cancel button on the approval form"},"continue_on_disapprove_timeout":{"type":"boolean","description":"If true, continue flow on timeout instead of canceling"}}},"priority":{"type":"number","description":"Execution priority for this step (higher numbers run first)"},"continue_on_error":{"type":"boolean","description":"If true, flow continues even if this step fails"},"retry":{"description":"Retry configuration if this step fails","$ref":"#/components/schemas/Retry"}},"required":["value","id"]},"InputTransform":{"description":"Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs","oneOf":[{"$ref":"#/components/schemas/StaticTransform"},{"$ref":"#/components/schemas/JavascriptTransform"},{"$ref":"#/components/schemas/AiTransform"}],"discriminator":{"propertyName":"type","mapping":{"static":"#/components/schemas/StaticTransform","javascript":"#/components/schemas/JavascriptTransform","ai":"#/components/schemas/AiTransform"}}},"StaticTransform":{"type":"object","description":"Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'","properties":{"value":{"description":"The static value. For resources, use format '$res:path/to/resource'"},"type":{"type":"string","enum":["static"]}},"required":["type"]},"JavascriptTransform":{"type":"object","description":"JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value","properties":{"expr":{"type":"string","description":"JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"},"type":{"type":"string","enum":["javascript"]}},"required":["expr","type"]},"AiTransform":{"type":"object","description":"Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.","properties":{"type":{"type":"string","enum":["ai"]}},"required":["type"]},"AIProviderKind":{"type":"string","description":"Supported AI provider types","enum":["openai","azure_openai","anthropic","mistral","deepseek","googleai","groq","openrouter","togetherai","customai","aws_bedrock"]},"ProviderConfig":{"type":"object","description":"Complete AI provider configuration with resource reference and model selection","properties":{"kind":{"$ref":"#/components/schemas/AIProviderKind"},"resource":{"type":"string","description":"Resource reference in format '$res:{resource_path}' pointing to provider credentials"},"model":{"type":"string","description":"Model identifier (e.g., 'gpt-4', 'claude-3-opus-20240229', 'gemini-pro')"}},"required":["kind","resource","model"]},"StaticProviderTransform":{"type":"object","description":"Static provider configuration passed directly to the AI agent","properties":{"value":{"$ref":"#/components/schemas/ProviderConfig"},"type":{"type":"string","enum":["static"]}},"required":["type","value"]},"ProviderTransform":{"description":"Provider configuration - can be static (ProviderConfig), JavaScript expression, or AI-determined","oneOf":[{"$ref":"#/components/schemas/StaticProviderTransform"},{"$ref":"#/components/schemas/JavascriptTransform"},{"$ref":"#/components/schemas/AiTransform"}],"discriminator":{"propertyName":"type","mapping":{"static":"#/components/schemas/StaticProviderTransform","javascript":"#/components/schemas/JavascriptTransform","ai":"#/components/schemas/AiTransform"}}},"MemoryOff":{"type":"object","description":"No conversation memory/context","properties":{"kind":{"type":"string","enum":["off"]}},"required":["kind"]},"MemoryAuto":{"type":"object","description":"Automatic context management","properties":{"kind":{"type":"string","enum":["auto"]},"context_length":{"type":"integer","description":"Maximum number of messages to retain in context"},"memory_id":{"type":"string","description":"Identifier for persistent memory across agent invocations"}},"required":["kind"]},"MemoryMessage":{"type":"object","description":"A single message in conversation history","properties":{"role":{"type":"string","enum":["user","assistant","system"]},"content":{"type":"string"}},"required":["role","content"]},"MemoryManual":{"type":"object","description":"Explicit message history","properties":{"kind":{"type":"string","enum":["manual"]},"messages":{"type":"array","items":{"$ref":"#/components/schemas/MemoryMessage"}}},"required":["kind","messages"]},"MemoryConfig":{"description":"Conversation memory configuration","oneOf":[{"$ref":"#/components/schemas/MemoryOff"},{"$ref":"#/components/schemas/MemoryAuto"},{"$ref":"#/components/schemas/MemoryManual"}],"discriminator":{"propertyName":"kind","mapping":{"off":"#/components/schemas/MemoryOff","auto":"#/components/schemas/MemoryAuto","manual":"#/components/schemas/MemoryManual"}}},"StaticMemoryTransform":{"type":"object","description":"Static memory configuration passed directly to the AI agent","properties":{"value":{"$ref":"#/components/schemas/MemoryConfig"},"type":{"type":"string","enum":["static"]}},"required":["type","value"]},"MemoryTransform":{"description":"Memory configuration - can be static (MemoryConfig), JavaScript expression, or AI-determined","oneOf":[{"$ref":"#/components/schemas/StaticMemoryTransform"},{"$ref":"#/components/schemas/JavascriptTransform"},{"$ref":"#/components/schemas/AiTransform"}],"discriminator":{"propertyName":"type","mapping":{"static":"#/components/schemas/StaticMemoryTransform","javascript":"#/components/schemas/JavascriptTransform","ai":"#/components/schemas/AiTransform"}}},"FlowModuleValue":{"description":"The actual implementation of a flow step. Can be a script (inline or referenced), subflow, loop, branch, or special module type","oneOf":[{"$ref":"#/components/schemas/RawScript"},{"$ref":"#/components/schemas/PathScript"},{"$ref":"#/components/schemas/PathFlow"},{"$ref":"#/components/schemas/ForloopFlow"},{"$ref":"#/components/schemas/WhileloopFlow"},{"$ref":"#/components/schemas/BranchOne"},{"$ref":"#/components/schemas/BranchAll"},{"$ref":"#/components/schemas/Identity"},{"$ref":"#/components/schemas/AiAgent"}],"discriminator":{"propertyName":"type","mapping":{"rawscript":"#/components/schemas/RawScript","script":"#/components/schemas/PathScript","flow":"#/components/schemas/PathFlow","forloopflow":"#/components/schemas/ForloopFlow","whileloopflow":"#/components/schemas/WhileloopFlow","branchone":"#/components/schemas/BranchOne","branchall":"#/components/schemas/BranchAll","identity":"#/components/schemas/Identity","aiagent":"#/components/schemas/AiAgent"}}},"RawScript":{"type":"object","description":"Inline script with code defined directly in the flow. Use 'bun' as default language if unspecified. The script receives arguments from input_transforms","properties":{"input_transforms":{"type":"object","description":"Map of parameter names to their values (static or JavaScript expressions). These become the script's input arguments","additionalProperties":{"$ref":"#/components/schemas/InputTransform"}},"content":{"type":"string","description":"The script source code. Should export a 'main' function"},"language":{"type":"string","description":"Programming language for this script","enum":["deno","bun","python3","go","bash","powershell","postgresql","mysql","bigquery","snowflake","mssql","oracledb","graphql","nativets","php"]},"path":{"type":"string","description":"Optional path for saving this script"},"lock":{"type":"string","description":"Lock file content for dependencies"},"type":{"type":"string","enum":["rawscript"]},"tag":{"type":"string","description":"Worker group tag for execution routing"},"concurrent_limit":{"type":"number","description":"Maximum concurrent executions of this script"},"concurrency_time_window_s":{"type":"number","description":"Time window for concurrent_limit"},"custom_concurrency_key":{"type":"string","description":"Custom key for grouping concurrent executions"},"is_trigger":{"type":"boolean","description":"If true, this script is a trigger that can start the flow"},"assets":{"type":"array","description":"External resources this script accesses (S3 objects, resources, etc.)","items":{"type":"object","required":["path","kind"],"properties":{"path":{"type":"string","description":"Path to the asset"},"kind":{"type":"string","description":"Type of asset","enum":["s3object","resource","ducklake","datatable"]},"access_type":{"type":"string","description":"Access level for this asset","enum":["r","w","rw"]},"alt_access_type":{"type":"string","description":"Alternative access level","enum":["r","w","rw"]}}}}},"required":["type","content","language","input_transforms"]},"PathScript":{"type":"object","description":"Reference to an existing script by path. Use this when calling a previously saved script instead of writing inline code","properties":{"input_transforms":{"type":"object","description":"Map of parameter names to their values (static or JavaScript expressions). These become the script's input arguments","additionalProperties":{"$ref":"#/components/schemas/InputTransform"}},"path":{"type":"string","description":"Path to the script in the workspace (e.g., 'f/scripts/send_email')"},"hash":{"type":"string","description":"Optional specific version hash of the script to use"},"type":{"type":"string","enum":["script"]},"tag_override":{"type":"string","description":"Override the script's default worker group tag"},"is_trigger":{"type":"boolean","description":"If true, this script is a trigger that can start the flow"}},"required":["type","path","input_transforms"]},"PathFlow":{"type":"object","description":"Reference to an existing flow by path. Use this to call another flow as a subflow","properties":{"input_transforms":{"type":"object","description":"Map of parameter names to their values (static or JavaScript expressions). These become the subflow's input arguments","additionalProperties":{"$ref":"#/components/schemas/InputTransform"}},"path":{"type":"string","description":"Path to the flow in the workspace (e.g., 'f/flows/process_user')"},"type":{"type":"string","enum":["flow"]}},"required":["type","path","input_transforms"]},"ForloopFlow":{"type":"object","description":"Executes nested modules in a loop over an iterator. Inside the loop, use 'flow_input.iter.value' to access the current iteration value, and 'flow_input.iter.index' for the index. Supports parallel execution for better performance on I/O-bound operations","properties":{"modules":{"type":"array","description":"Steps to execute for each iteration. These can reference the iteration value via 'flow_input.iter.value'","items":{"$ref":"#/components/schemas/FlowModule"}},"iterator":{"description":"JavaScript expression that returns an array to iterate over. Can reference 'results.step_id' or 'flow_input'","$ref":"#/components/schemas/InputTransform"},"skip_failures":{"type":"boolean","description":"If true, iteration failures don't stop the loop. Failed iterations return null"},"type":{"type":"string","enum":["forloopflow"]},"parallel":{"type":"boolean","description":"If true, iterations run concurrently (faster for I/O-bound operations). Use with parallelism to control concurrency"},"parallelism":{"description":"Maximum number of concurrent iterations when parallel=true. Limits resource usage. Can be static number or expression","$ref":"#/components/schemas/InputTransform"},"squash":{"type":"boolean"}},"required":["modules","iterator","skip_failures","type"]},"WhileloopFlow":{"type":"object","description":"Executes nested modules repeatedly while a condition is true. The loop checks the condition after each iteration. Use stop_after_if on modules to control loop termination","properties":{"modules":{"type":"array","description":"Steps to execute in each iteration. Use stop_after_if to control when the loop ends","items":{"$ref":"#/components/schemas/FlowModule"}},"skip_failures":{"type":"boolean","description":"If true, iteration failures don't stop the loop. Failed iterations return null"},"type":{"type":"string","enum":["whileloopflow"]},"parallel":{"type":"boolean","description":"If true, iterations run concurrently (use with caution in while loops)"},"parallelism":{"description":"Maximum number of concurrent iterations when parallel=true","$ref":"#/components/schemas/InputTransform"},"squash":{"type":"boolean"}},"required":["modules","skip_failures","type"]},"BranchOne":{"type":"object","description":"Conditional branching where only the first matching branch executes. Branches are evaluated in order, and the first one with a true expression runs. If no branches match, the default branch executes","properties":{"branches":{"type":"array","description":"Array of branches to evaluate in order. The first branch with expr evaluating to true executes","items":{"type":"object","properties":{"summary":{"type":"string","description":"Short description of this branch condition"},"expr":{"type":"string","description":"JavaScript expression that returns boolean. Can use 'results.step_id' or 'flow_input'. First true expr wins"},"modules":{"type":"array","description":"Steps to execute if this branch's expr is true","items":{"$ref":"#/components/schemas/FlowModule"}}},"required":["modules","expr"]}},"default":{"type":"array","description":"Steps to execute if no branch expressions match","items":{"$ref":"#/components/schemas/FlowModule"}},"type":{"type":"string","enum":["branchone"]}},"required":["branches","default","type"]},"BranchAll":{"type":"object","description":"Parallel branching where all branches execute simultaneously. Unlike BranchOne, all branches run regardless of conditions. Useful for executing independent tasks concurrently","properties":{"branches":{"type":"array","description":"Array of branches that all execute (either in parallel or sequentially)","items":{"type":"object","properties":{"summary":{"type":"string","description":"Short description of this branch's purpose"},"skip_failure":{"type":"boolean","description":"If true, failure in this branch doesn't fail the entire flow"},"modules":{"type":"array","description":"Steps to execute in this branch","items":{"$ref":"#/components/schemas/FlowModule"}}},"required":["modules"]}},"type":{"type":"string","enum":["branchall"]},"parallel":{"type":"boolean","description":"If true, all branches execute concurrently. If false, they execute sequentially"}},"required":["branches","type"]},"AgentTool":{"type":"object","description":"A tool available to an AI agent. Can be a flow module or an external MCP (Model Context Protocol) tool","properties":{"id":{"type":"string","description":"Unique identifier for this tool. Cannot contain spaces - use underscores instead (e.g., 'get_user_data' not 'get user data')"},"summary":{"type":"string","description":"Short description of what this tool does (shown to the AI)"},"value":{"$ref":"#/components/schemas/ToolValue"}},"required":["id","value"]},"ToolValue":{"description":"The implementation of a tool. Can be a flow module (script/flow) or an MCP tool reference","oneOf":[{"$ref":"#/components/schemas/FlowModuleTool"},{"$ref":"#/components/schemas/McpToolValue"},{"$ref":"#/components/schemas/WebsearchToolValue"}],"discriminator":{"propertyName":"tool_type","mapping":{"flowmodule":"#/components/schemas/FlowModuleTool","mcp":"#/components/schemas/McpToolValue","websearch":"#/components/schemas/WebsearchToolValue"}}},"FlowModuleTool":{"description":"A tool implemented as a flow module (script, flow, etc.). The AI can call this like any other flow module","allOf":[{"type":"object","properties":{"tool_type":{"type":"string","enum":["flowmodule"]}},"required":["tool_type"]},{"$ref":"#/components/schemas/FlowModuleValue"}]},"WebsearchToolValue":{"type":"object","description":"A tool implemented as a websearch tool. The AI can call this like any other websearch tool","properties":{"tool_type":{"type":"string","enum":["websearch"]}},"required":["tool_type"]},"McpToolValue":{"type":"object","description":"Reference to an external MCP (Model Context Protocol) tool. The AI can call tools from MCP servers","properties":{"tool_type":{"type":"string","enum":["mcp"]},"resource_path":{"type":"string","description":"Path to the MCP resource/server configuration"},"include_tools":{"type":"array","description":"Whitelist of specific tools to include from this MCP server","items":{"type":"string"}},"exclude_tools":{"type":"array","description":"Blacklist of tools to exclude from this MCP server","items":{"type":"string"}}},"required":["tool_type","resource_path"]},"AiAgent":{"type":"object","description":"AI agent step that can use tools to accomplish tasks. The agent receives inputs and can call any of its configured tools to complete the task","properties":{"input_transforms":{"type":"object","description":"Input parameters for the AI agent mapped to their values","properties":{"provider":{"$ref":"#/components/schemas/ProviderTransform"},"output_type":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Output format type.\\nValid values: 'text' (default) - plain text response, 'image' - image generation\\n"},"user_message":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"The user's prompt/message to the AI agent. Supports variable interpolation with flow.input syntax."},"system_prompt":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"System instructions that guide the AI's behavior, persona, and response style. Optional."},"streaming":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Boolean. If true, stream the AI response incrementally.\\nStreaming events include: token_delta, tool_call, tool_call_arguments, tool_execution, tool_result\\n"},"memory":{"$ref":"#/components/schemas/MemoryTransform"},"output_schema":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"JSON Schema object defining structured output format. Used when you need the AI to return data in a specific shape.\\nSupports standard JSON Schema properties: type, properties, required, items, enum, pattern, minLength, maxLength, minimum, maximum, etc.\\nExample: { type: 'object', properties: { name: { type: 'string' }, age: { type: 'integer' } }, required: ['name'] }\\n"},"user_images":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Array of image references for vision-capable models.\\nFormat: Array<{ bucket: string, key: string }> - S3 object references\\nExample: [{ bucket: 'my-bucket', key: 'images/photo.jpg' }]\\n"},"max_completion_tokens":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Integer. Maximum number of tokens the AI will generate in its response.\\nRange: 1 to 4,294,967,295. Typical values: 256-4096 for most use cases.\\n"},"temperature":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Float. Controls randomness/creativity of responses.\\nRange: 0.0 to 2.0 (provider-dependent)\\n- 0.0 = deterministic, focused responses\\n- 0.7 = balanced (common default)\\n- 1.0+ = more creative/random\\n"}},"required":["provider","user_message","output_type"]},"tools":{"type":"array","description":"Array of tools the agent can use. The agent decides which tools to call based on the task","items":{"$ref":"#/components/schemas/AgentTool"}},"type":{"type":"string","enum":["aiagent"]},"parallel":{"type":"boolean","description":"If true, the agent can execute multiple tool calls in parallel"}},"required":["tools","type","input_transforms"]},"Identity":{"type":"object","description":"Pass-through module that returns its input unchanged. Useful for flow structure or as a placeholder","properties":{"type":{"type":"string","enum":["identity"]},"flow":{"type":"boolean","description":"If true, marks this as a flow identity (special handling)"}},"required":["type"]},"FlowStatus":{"type":"object","properties":{"step":{"type":"integer"},"modules":{"type":"array","items":{"$ref":"#/components/schemas/FlowStatusModule"}},"user_states":{"additionalProperties":true},"preprocessor_module":{"allOf":[{"$ref":"#/components/schemas/FlowStatusModule"}]},"failure_module":{"allOf":[{"$ref":"#/components/schemas/FlowStatusModule"},{"type":"object","properties":{"parent_module":{"type":"string"}}}]},"retry":{"type":"object","properties":{"fail_count":{"type":"integer"},"failed_jobs":{"type":"array","items":{"type":"string","format":"uuid"}}}}},"required":["step","modules","failure_module"]},"FlowStatusModule":{"type":"object","properties":{"type":{"type":"string","enum":["WaitingForPriorSteps","WaitingForEvents","WaitingForExecutor","InProgress","Success","Failure"]},"id":{"type":"string"},"job":{"type":"string","format":"uuid"},"count":{"type":"integer"},"progress":{"type":"integer"},"iterator":{"type":"object","properties":{"index":{"type":"integer"},"itered":{"type":"array","items":{}},"itered_len":{"type":"integer"},"args":{}}},"flow_jobs":{"type":"array","items":{"type":"string"}},"flow_jobs_success":{"type":"array","items":{"type":"boolean"}},"flow_jobs_duration":{"type":"object","properties":{"started_at":{"type":"array","items":{"type":"string"}},"duration_ms":{"type":"array","items":{"type":"integer"}}}},"branch_chosen":{"type":"object","properties":{"type":{"type":"string","enum":["branch","default"]},"branch":{"type":"integer"}},"required":["type"]},"branchall":{"type":"object","properties":{"branch":{"type":"integer"},"len":{"type":"integer"}},"required":["branch","len"]},"approvers":{"type":"array","items":{"type":"object","properties":{"resume_id":{"type":"integer"},"approver":{"type":"string"}},"required":["resume_id","approver"]}},"failed_retries":{"type":"array","items":{"type":"string","format":"uuid"}},"skipped":{"type":"boolean"},"agent_actions":{"type":"array","items":{"type":"object","oneOf":[{"type":"object","properties":{"job_id":{"type":"string","format":"uuid"},"function_name":{"type":"string"},"type":{"type":"string","enum":["tool_call"]},"module_id":{"type":"string"}},"required":["job_id","function_name","type","module_id"]},{"type":"object","properties":{"call_id":{"type":"string","format":"uuid"},"function_name":{"type":"string"},"resource_path":{"type":"string"},"type":{"type":"string","enum":["mcp_tool_call"]},"arguments":{"type":"object"}},"required":["call_id","function_name","resource_path","type"]},{"type":"object","properties":{"type":{"type":"string","enum":["web_search"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["message"]}},"required":["content","type"]}]}},"agent_actions_success":{"type":"array","items":{"type":"boolean"}}},"required":["type"]}}`;
|
|
1368
|
+
{"OpenFlow":{"type":"object","description":"Top-level flow definition containing metadata, configuration, and the flow structure","properties":{"summary":{"type":"string","description":"Short description of what this flow does"},"description":{"type":"string","description":"Detailed documentation for this flow"},"value":{"$ref":"#/components/schemas/FlowValue"},"schema":{"type":"object","description":"JSON Schema for flow inputs. Use this to define input parameters, their types, defaults, and validation. For resource inputs, set type to 'object' and format to 'resource-<type>' (e.g., 'resource-stripe')"},"on_behalf_of_email":{"type":"string","description":"The flow will be run with the permissions of the user with this email."}},"required":["summary","value"]},"FlowValue":{"type":"object","description":"The flow structure containing modules and optional preprocessor/failure handlers","properties":{"modules":{"type":"array","description":"Array of steps that execute in sequence. Each step can be a script, subflow, loop, or branch","items":{"$ref":"#/components/schemas/FlowModule"}},"failure_module":{"description":"Special module that executes when the flow fails. Receives error object with message, name, stack, and step_id. Must have id 'failure'. Only supports script/rawscript types","$ref":"#/components/schemas/FlowModule"},"preprocessor_module":{"description":"Special module that runs before the first step on external triggers. Must have id 'preprocessor'. Only supports script/rawscript types. Cannot reference other step results","$ref":"#/components/schemas/FlowModule"},"same_worker":{"type":"boolean","description":"If true, all steps run on the same worker for better performance"},"concurrent_limit":{"type":"number","description":"Maximum number of concurrent executions of this flow"},"concurrency_key":{"type":"string","description":"Expression to group concurrent executions (e.g., by user ID)"},"concurrency_time_window_s":{"type":"number","description":"Time window in seconds for concurrent_limit"},"debounce_delay_s":{"type":"number","description":"Delay in seconds to debounce flow executions"},"debounce_key":{"type":"string","description":"Expression to group debounced executions"},"debounce_args_to_accumulate":{"type":"array","description":"Arguments to accumulate across debounced executions","items":{"type":"string"}},"max_total_debouncing_time":{"type":"number","description":"Maximum total time in seconds that a job can be debounced"},"max_total_debounces_amount":{"type":"number","description":"Maximum number of times a job can be debounced"},"skip_expr":{"type":"string","description":"JavaScript expression to conditionally skip the entire flow"},"cache_ttl":{"type":"number","description":"Cache duration in seconds for flow results"},"cache_ignore_s3_path":{"type":"boolean"},"flow_env":{"type":"object","description":"Environment variables available to all steps. Values can be strings, JSON values, or special references: '$var:path' (workspace variable) or '$res:path' (resource).","additionalProperties":{}},"priority":{"type":"number","description":"Execution priority (higher numbers run first)"},"early_return":{"type":"string","description":"JavaScript expression to return early from the flow"},"chat_input_enabled":{"type":"boolean","description":"Whether this flow accepts chat-style input"},"notes":{"type":"array","description":"Sticky notes attached to the flow","items":{"$ref":"#/components/schemas/FlowNote"}}},"required":["modules"]},"Retry":{"type":"object","description":"Retry configuration for failed module executions","properties":{"constant":{"type":"object","description":"Retry with constant delay between attempts","properties":{"attempts":{"type":"integer","description":"Number of retry attempts"},"seconds":{"type":"integer","description":"Seconds to wait between retries"}}},"exponential":{"type":"object","description":"Retry with exponential backoff (delay doubles each time)","properties":{"attempts":{"type":"integer","description":"Number of retry attempts"},"multiplier":{"type":"integer","description":"Multiplier for exponential backoff"},"seconds":{"type":"integer","minimum":1,"description":"Initial delay in seconds"},"random_factor":{"type":"integer","minimum":0,"maximum":100,"description":"Random jitter percentage (0-100) to avoid thundering herd"}}},"retry_if":{"$ref":"#/components/schemas/RetryIf"}}},"FlowNote":{"type":"object","description":"A sticky note attached to a flow for documentation and annotation","properties":{"id":{"type":"string","description":"Unique identifier for the note"},"text":{"type":"string","description":"Content of the note"},"position":{"type":"object","description":"Position of the note in the flow editor","properties":{"x":{"type":"number","description":"X coordinate"},"y":{"type":"number","description":"Y coordinate"}},"required":["x","y"]},"size":{"type":"object","description":"Size of the note in the flow editor","properties":{"width":{"type":"number","description":"Width in pixels"},"height":{"type":"number","description":"Height in pixels"}},"required":["width","height"]},"color":{"type":"string","description":"Color of the note (e.g., \\"yellow\\", \\"#ffff00\\")"},"type":{"type":"string","enum":["free","group"],"description":"Type of note - 'free' for standalone notes, 'group' for notes that group other nodes"},"locked":{"type":"boolean","default":false,"description":"Whether the note is locked and cannot be edited or moved"},"contained_node_ids":{"type":"array","items":{"type":"string"},"description":"For group notes, the IDs of nodes contained within this group"}},"required":["id","text","color","type"]},"RetryIf":{"type":"object","description":"Conditional retry based on error or result","properties":{"expr":{"type":"string","description":"JavaScript expression that returns true to retry. Has access to 'result' and 'error' variables"}},"required":["expr"]},"StopAfterIf":{"type":"object","description":"Early termination condition for a module","properties":{"skip_if_stopped":{"type":"boolean","description":"If true, following steps are skipped when this condition triggers"},"expr":{"type":"string","description":"JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"},"error_message":{"type":"string","description":"Custom error message shown when stopping"}},"required":["expr"]},"FlowModule":{"type":"object","description":"A single step in a flow. Can be a script, subflow, loop, or branch","properties":{"id":{"type":"string","description":"Unique identifier for this step. Used to reference results via 'results.step_id'. Must be a valid identifier (alphanumeric, underscore, hyphen)"},"value":{"$ref":"#/components/schemas/FlowModuleValue"},"stop_after_if":{"description":"Early termination condition evaluated after this step completes","$ref":"#/components/schemas/StopAfterIf"},"stop_after_all_iters_if":{"description":"For loops only - early termination condition evaluated after all iterations complete","$ref":"#/components/schemas/StopAfterIf"},"skip_if":{"type":"object","description":"Conditionally skip this step based on previous results or flow inputs","properties":{"expr":{"type":"string","description":"JavaScript expression that returns true to skip. Can use 'flow_input' or 'results.<step_id>'"}},"required":["expr"]},"sleep":{"description":"Delay before executing this step (in seconds or as expression)","$ref":"#/components/schemas/InputTransform"},"cache_ttl":{"type":"number","description":"Cache duration in seconds for this step's results"},"cache_ignore_s3_path":{"type":"boolean"},"timeout":{"description":"Maximum execution time in seconds (static value or expression)","$ref":"#/components/schemas/InputTransform"},"delete_after_use":{"type":"boolean","description":"If true, this step's result is deleted after use to save memory"},"summary":{"type":"string","description":"Short description of what this step does"},"mock":{"type":"object","description":"Mock configuration for testing without executing the actual step","properties":{"enabled":{"type":"boolean","description":"If true, return mock value instead of executing"},"return_value":{"description":"Value to return when mocked"}}},"suspend":{"type":"object","description":"Configuration for approval/resume steps that wait for user input","properties":{"required_events":{"type":"integer","description":"Number of approvals required before continuing"},"timeout":{"type":"integer","description":"Timeout in seconds before auto-continuing or canceling"},"resume_form":{"type":"object","description":"Form schema for collecting input when resuming","properties":{"schema":{"type":"object","description":"JSON Schema for the resume form"}}},"user_auth_required":{"type":"boolean","description":"If true, only authenticated users can approve"},"user_groups_required":{"description":"Expression or list of groups that can approve","$ref":"#/components/schemas/InputTransform"},"self_approval_disabled":{"type":"boolean","description":"If true, the user who started the flow cannot approve"},"hide_cancel":{"type":"boolean","description":"If true, hide the cancel button on the approval form"},"continue_on_disapprove_timeout":{"type":"boolean","description":"If true, continue flow on timeout instead of canceling"}}},"priority":{"type":"number","description":"Execution priority for this step (higher numbers run first)"},"continue_on_error":{"type":"boolean","description":"If true, flow continues even if this step fails"},"retry":{"description":"Retry configuration if this step fails","$ref":"#/components/schemas/Retry"}},"required":["value","id"]},"InputTransform":{"description":"Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs","oneOf":[{"$ref":"#/components/schemas/StaticTransform"},{"$ref":"#/components/schemas/JavascriptTransform"},{"$ref":"#/components/schemas/AiTransform"}],"discriminator":{"propertyName":"type","mapping":{"static":"#/components/schemas/StaticTransform","javascript":"#/components/schemas/JavascriptTransform","ai":"#/components/schemas/AiTransform"}}},"StaticTransform":{"type":"object","description":"Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'","properties":{"value":{"description":"The static value. For resources, use format '$res:path/to/resource'"},"type":{"type":"string","enum":["static"]}},"required":["type"]},"JavascriptTransform":{"type":"object","description":"JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value","properties":{"expr":{"type":"string","description":"JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"},"type":{"type":"string","enum":["javascript"]}},"required":["expr","type"]},"AiTransform":{"type":"object","description":"Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.","properties":{"type":{"type":"string","enum":["ai"]}},"required":["type"]},"AIProviderKind":{"type":"string","description":"Supported AI provider types","enum":["openai","azure_openai","anthropic","mistral","deepseek","googleai","groq","openrouter","togetherai","customai","aws_bedrock"]},"ProviderConfig":{"type":"object","description":"Complete AI provider configuration with resource reference and model selection","properties":{"kind":{"$ref":"#/components/schemas/AIProviderKind"},"resource":{"type":"string","description":"Resource reference in format '$res:{resource_path}' pointing to provider credentials"},"model":{"type":"string","description":"Model identifier (e.g., 'gpt-4', 'claude-3-opus-20240229', 'gemini-pro')"}},"required":["kind","resource","model"]},"StaticProviderTransform":{"type":"object","description":"Static provider configuration passed directly to the AI agent","properties":{"value":{"$ref":"#/components/schemas/ProviderConfig"},"type":{"type":"string","enum":["static"]}},"required":["type","value"]},"ProviderTransform":{"description":"Provider configuration - can be static (ProviderConfig), JavaScript expression, or AI-determined","oneOf":[{"$ref":"#/components/schemas/StaticProviderTransform"},{"$ref":"#/components/schemas/JavascriptTransform"},{"$ref":"#/components/schemas/AiTransform"}],"discriminator":{"propertyName":"type","mapping":{"static":"#/components/schemas/StaticProviderTransform","javascript":"#/components/schemas/JavascriptTransform","ai":"#/components/schemas/AiTransform"}}},"MemoryOff":{"type":"object","description":"No conversation memory/context","properties":{"kind":{"type":"string","enum":["off"]}},"required":["kind"]},"MemoryAuto":{"type":"object","description":"Automatic context management","properties":{"kind":{"type":"string","enum":["auto"]},"context_length":{"type":"integer","description":"Maximum number of messages to retain in context"},"memory_id":{"type":"string","description":"Identifier for persistent memory across agent invocations"}},"required":["kind"]},"MemoryMessage":{"type":"object","description":"A single message in conversation history","properties":{"role":{"type":"string","enum":["user","assistant","system"]},"content":{"type":"string"}},"required":["role","content"]},"MemoryManual":{"type":"object","description":"Explicit message history","properties":{"kind":{"type":"string","enum":["manual"]},"messages":{"type":"array","items":{"$ref":"#/components/schemas/MemoryMessage"}}},"required":["kind","messages"]},"MemoryConfig":{"description":"Conversation memory configuration","oneOf":[{"$ref":"#/components/schemas/MemoryOff"},{"$ref":"#/components/schemas/MemoryAuto"},{"$ref":"#/components/schemas/MemoryManual"}],"discriminator":{"propertyName":"kind","mapping":{"off":"#/components/schemas/MemoryOff","auto":"#/components/schemas/MemoryAuto","manual":"#/components/schemas/MemoryManual"}}},"StaticMemoryTransform":{"type":"object","description":"Static memory configuration passed directly to the AI agent","properties":{"value":{"$ref":"#/components/schemas/MemoryConfig"},"type":{"type":"string","enum":["static"]}},"required":["type","value"]},"MemoryTransform":{"description":"Memory configuration - can be static (MemoryConfig), JavaScript expression, or AI-determined","oneOf":[{"$ref":"#/components/schemas/StaticMemoryTransform"},{"$ref":"#/components/schemas/JavascriptTransform"},{"$ref":"#/components/schemas/AiTransform"}],"discriminator":{"propertyName":"type","mapping":{"static":"#/components/schemas/StaticMemoryTransform","javascript":"#/components/schemas/JavascriptTransform","ai":"#/components/schemas/AiTransform"}}},"FlowModuleValue":{"description":"The actual implementation of a flow step. Can be a script (inline or referenced), subflow, loop, branch, or special module type","oneOf":[{"$ref":"#/components/schemas/RawScript"},{"$ref":"#/components/schemas/PathScript"},{"$ref":"#/components/schemas/PathFlow"},{"$ref":"#/components/schemas/ForloopFlow"},{"$ref":"#/components/schemas/WhileloopFlow"},{"$ref":"#/components/schemas/BranchOne"},{"$ref":"#/components/schemas/BranchAll"},{"$ref":"#/components/schemas/Identity"},{"$ref":"#/components/schemas/AiAgent"}],"discriminator":{"propertyName":"type","mapping":{"rawscript":"#/components/schemas/RawScript","script":"#/components/schemas/PathScript","flow":"#/components/schemas/PathFlow","forloopflow":"#/components/schemas/ForloopFlow","whileloopflow":"#/components/schemas/WhileloopFlow","branchone":"#/components/schemas/BranchOne","branchall":"#/components/schemas/BranchAll","identity":"#/components/schemas/Identity","aiagent":"#/components/schemas/AiAgent"}}},"RawScript":{"type":"object","description":"Inline script with code defined directly in the flow. Use 'bun' as default language if unspecified. The script receives arguments from input_transforms","properties":{"input_transforms":{"type":"object","description":"Map of parameter names to their values (static or JavaScript expressions). These become the script's input arguments","additionalProperties":{"$ref":"#/components/schemas/InputTransform"}},"content":{"type":"string","description":"The script source code. Should export a 'main' function"},"language":{"type":"string","description":"Programming language for this script","enum":["deno","bun","python3","go","bash","powershell","postgresql","mysql","bigquery","snowflake","mssql","oracledb","graphql","nativets","php","rust","ansible","csharp","nu","java","ruby","duckdb"]},"path":{"type":"string","description":"Optional path for saving this script"},"lock":{"type":"string","description":"Lock file content for dependencies"},"type":{"type":"string","enum":["rawscript"]},"tag":{"type":"string","description":"Worker group tag for execution routing"},"concurrent_limit":{"type":"number","description":"Maximum concurrent executions of this script"},"concurrency_time_window_s":{"type":"number","description":"Time window for concurrent_limit"},"custom_concurrency_key":{"type":"string","description":"Custom key for grouping concurrent executions"},"is_trigger":{"type":"boolean","description":"If true, this script is a trigger that can start the flow"},"assets":{"type":"array","description":"External resources this script accesses (S3 objects, resources, etc.)","items":{"type":"object","required":["path","kind"],"properties":{"path":{"type":"string","description":"Path to the asset"},"kind":{"type":"string","description":"Type of asset","enum":["s3object","resource","ducklake","datatable","volume"]},"access_type":{"type":"string","nullable":true,"description":"Access level for this asset","enum":["r","w","rw"]},"alt_access_type":{"type":"string","nullable":true,"description":"Alternative access level","enum":["r","w","rw"]}}}}},"required":["type","content","language","input_transforms"]},"PathScript":{"type":"object","description":"Reference to an existing script by path. Use this when calling a previously saved script instead of writing inline code","properties":{"input_transforms":{"type":"object","description":"Map of parameter names to their values (static or JavaScript expressions). These become the script's input arguments","additionalProperties":{"$ref":"#/components/schemas/InputTransform"}},"path":{"type":"string","description":"Path to the script in the workspace (e.g., 'f/scripts/send_email')"},"hash":{"type":"string","description":"Optional specific version hash of the script to use"},"type":{"type":"string","enum":["script"]},"tag_override":{"type":"string","description":"Override the script's default worker group tag"},"is_trigger":{"type":"boolean","description":"If true, this script is a trigger that can start the flow"}},"required":["type","path","input_transforms"]},"PathFlow":{"type":"object","description":"Reference to an existing flow by path. Use this to call another flow as a subflow","properties":{"input_transforms":{"type":"object","description":"Map of parameter names to their values (static or JavaScript expressions). These become the subflow's input arguments","additionalProperties":{"$ref":"#/components/schemas/InputTransform"}},"path":{"type":"string","description":"Path to the flow in the workspace (e.g., 'f/flows/process_user')"},"type":{"type":"string","enum":["flow"]}},"required":["type","path","input_transforms"]},"ForloopFlow":{"type":"object","description":"Executes nested modules in a loop over an iterator. Inside the loop, use 'flow_input.iter.value' to access the current iteration value, and 'flow_input.iter.index' for the index. Supports parallel execution for better performance on I/O-bound operations","properties":{"modules":{"type":"array","description":"Steps to execute for each iteration. These can reference the iteration value via 'flow_input.iter.value'","items":{"$ref":"#/components/schemas/FlowModule"}},"iterator":{"description":"JavaScript expression that returns an array to iterate over. Can reference 'results.step_id' or 'flow_input'","$ref":"#/components/schemas/InputTransform"},"skip_failures":{"type":"boolean","description":"If true, iteration failures don't stop the loop. Failed iterations return null"},"type":{"type":"string","enum":["forloopflow"]},"parallel":{"type":"boolean","description":"If true, iterations run concurrently (faster for I/O-bound operations). Use with parallelism to control concurrency"},"parallelism":{"description":"Maximum number of concurrent iterations when parallel=true. Limits resource usage. Can be static number or expression","$ref":"#/components/schemas/InputTransform"},"squash":{"type":"boolean"}},"required":["modules","iterator","skip_failures","type"]},"WhileloopFlow":{"type":"object","description":"Executes nested modules repeatedly while a condition is true. The loop checks the condition after each iteration. Use stop_after_if on modules to control loop termination","properties":{"modules":{"type":"array","description":"Steps to execute in each iteration. Use stop_after_if to control when the loop ends","items":{"$ref":"#/components/schemas/FlowModule"}},"skip_failures":{"type":"boolean","description":"If true, iteration failures don't stop the loop. Failed iterations return null"},"type":{"type":"string","enum":["whileloopflow"]},"parallel":{"type":"boolean","description":"If true, iterations run concurrently (use with caution in while loops)"},"parallelism":{"description":"Maximum number of concurrent iterations when parallel=true","$ref":"#/components/schemas/InputTransform"},"squash":{"type":"boolean"}},"required":["modules","skip_failures","type"]},"BranchOne":{"type":"object","description":"Conditional branching where only the first matching branch executes. Branches are evaluated in order, and the first one with a true expression runs. If no branches match, the default branch executes","properties":{"branches":{"type":"array","description":"Array of branches to evaluate in order. The first branch with expr evaluating to true executes","items":{"type":"object","properties":{"summary":{"type":"string","description":"Short description of this branch condition"},"expr":{"type":"string","description":"JavaScript expression that returns boolean. Can use 'results.step_id' or 'flow_input'. First true expr wins"},"modules":{"type":"array","description":"Steps to execute if this branch's expr is true","items":{"$ref":"#/components/schemas/FlowModule"}}},"required":["modules","expr"]}},"default":{"type":"array","description":"Steps to execute if no branch expressions match","items":{"$ref":"#/components/schemas/FlowModule"}},"type":{"type":"string","enum":["branchone"]}},"required":["branches","default","type"]},"BranchAll":{"type":"object","description":"Parallel branching where all branches execute simultaneously. Unlike BranchOne, all branches run regardless of conditions. Useful for executing independent tasks concurrently","properties":{"branches":{"type":"array","description":"Array of branches that all execute (either in parallel or sequentially)","items":{"type":"object","properties":{"summary":{"type":"string","description":"Short description of this branch's purpose"},"skip_failure":{"type":"boolean","description":"If true, failure in this branch doesn't fail the entire flow"},"modules":{"type":"array","description":"Steps to execute in this branch","items":{"$ref":"#/components/schemas/FlowModule"}}},"required":["modules"]}},"type":{"type":"string","enum":["branchall"]},"parallel":{"type":"boolean","description":"If true, all branches execute concurrently. If false, they execute sequentially"}},"required":["branches","type"]},"AgentTool":{"type":"object","description":"A tool available to an AI agent. Can be a flow module or an external MCP (Model Context Protocol) tool","properties":{"id":{"type":"string","description":"Unique identifier for this tool. Cannot contain spaces - use underscores instead (e.g., 'get_user_data' not 'get user data')"},"summary":{"type":"string","description":"Short description of what this tool does (shown to the AI)"},"value":{"$ref":"#/components/schemas/ToolValue"}},"required":["id","value"]},"ToolValue":{"description":"The implementation of a tool. Can be a flow module (script/flow) or an MCP tool reference","oneOf":[{"$ref":"#/components/schemas/FlowModuleTool"},{"$ref":"#/components/schemas/McpToolValue"},{"$ref":"#/components/schemas/WebsearchToolValue"}],"discriminator":{"propertyName":"tool_type","mapping":{"flowmodule":"#/components/schemas/FlowModuleTool","mcp":"#/components/schemas/McpToolValue","websearch":"#/components/schemas/WebsearchToolValue"}}},"FlowModuleTool":{"description":"A tool implemented as a flow module (script, flow, etc.). The AI can call this like any other flow module","allOf":[{"type":"object","properties":{"tool_type":{"type":"string","enum":["flowmodule"]}},"required":["tool_type"]},{"$ref":"#/components/schemas/FlowModuleValue"}]},"WebsearchToolValue":{"type":"object","description":"A tool implemented as a websearch tool. The AI can call this like any other websearch tool","properties":{"tool_type":{"type":"string","enum":["websearch"]}},"required":["tool_type"]},"McpToolValue":{"type":"object","description":"Reference to an external MCP (Model Context Protocol) tool. The AI can call tools from MCP servers","properties":{"tool_type":{"type":"string","enum":["mcp"]},"resource_path":{"type":"string","description":"Path to the MCP resource/server configuration"},"include_tools":{"type":"array","description":"Whitelist of specific tools to include from this MCP server","items":{"type":"string"}},"exclude_tools":{"type":"array","description":"Blacklist of tools to exclude from this MCP server","items":{"type":"string"}}},"required":["tool_type","resource_path"]},"AiAgent":{"type":"object","description":"AI agent step that can use tools to accomplish tasks. The agent receives inputs and can call any of its configured tools to complete the task","properties":{"input_transforms":{"type":"object","description":"Input parameters for the AI agent mapped to their values","properties":{"provider":{"$ref":"#/components/schemas/ProviderTransform"},"output_type":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Output format type.\\nValid values: 'text' (default) - plain text response, 'image' - image generation\\n"},"user_message":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"The user's prompt/message to the AI agent. Supports variable interpolation with flow.input syntax."},"system_prompt":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"System instructions that guide the AI's behavior, persona, and response style. Optional."},"streaming":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Boolean. If true, stream the AI response incrementally.\\nStreaming events include: token_delta, tool_call, tool_call_arguments, tool_execution, tool_result\\n"},"memory":{"$ref":"#/components/schemas/MemoryTransform"},"output_schema":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"JSON Schema object defining structured output format. Used when you need the AI to return data in a specific shape.\\nSupports standard JSON Schema properties: type, properties, required, items, enum, pattern, minLength, maxLength, minimum, maximum, etc.\\nExample: { type: 'object', properties: { name: { type: 'string' }, age: { type: 'integer' } }, required: ['name'] }\\n"},"user_images":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Array of image references for vision-capable models.\\nFormat: Array<{ bucket: string, key: string }> - S3 object references\\nExample: [{ bucket: 'my-bucket', key: 'images/photo.jpg' }]\\n"},"max_completion_tokens":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Integer. Maximum number of tokens the AI will generate in its response.\\nRange: 1 to 4,294,967,295. Typical values: 256-4096 for most use cases.\\n"},"temperature":{"allOf":[{"$ref":"#/components/schemas/InputTransform"}],"description":"Float. Controls randomness/creativity of responses.\\nRange: 0.0 to 2.0 (provider-dependent)\\n- 0.0 = deterministic, focused responses\\n- 0.7 = balanced (common default)\\n- 1.0+ = more creative/random\\n"}},"required":["provider","user_message","output_type"]},"tools":{"type":"array","description":"Array of tools the agent can use. The agent decides which tools to call based on the task","items":{"$ref":"#/components/schemas/AgentTool"}},"type":{"type":"string","enum":["aiagent"]},"parallel":{"type":"boolean","description":"If true, the agent can execute multiple tool calls in parallel"}},"required":["tools","type","input_transforms"]},"Identity":{"type":"object","description":"Pass-through module that returns its input unchanged. Useful for flow structure or as a placeholder","properties":{"type":{"type":"string","enum":["identity"]},"flow":{"type":"boolean","description":"If true, marks this as a flow identity (special handling)"}},"required":["type"]},"FlowStatus":{"type":"object","properties":{"step":{"type":"integer"},"modules":{"type":"array","items":{"$ref":"#/components/schemas/FlowStatusModule"}},"user_states":{"additionalProperties":true},"preprocessor_module":{"allOf":[{"$ref":"#/components/schemas/FlowStatusModule"}]},"failure_module":{"allOf":[{"$ref":"#/components/schemas/FlowStatusModule"},{"type":"object","properties":{"parent_module":{"type":"string"}}}]},"retry":{"type":"object","properties":{"fail_count":{"type":"integer"},"failed_jobs":{"type":"array","items":{"type":"string","format":"uuid"}}}}},"required":["step","modules","failure_module"]},"FlowStatusModule":{"type":"object","properties":{"type":{"type":"string","enum":["WaitingForPriorSteps","WaitingForEvents","WaitingForExecutor","InProgress","Success","Failure"]},"id":{"type":"string"},"job":{"type":"string","format":"uuid"},"count":{"type":"integer"},"progress":{"type":"integer"},"iterator":{"type":"object","properties":{"index":{"type":"integer"},"itered":{"type":"array","items":{}},"itered_len":{"type":"integer"},"args":{}}},"flow_jobs":{"type":"array","items":{"type":"string"}},"flow_jobs_success":{"type":"array","items":{"type":"boolean"}},"flow_jobs_duration":{"type":"object","properties":{"started_at":{"type":"array","items":{"type":"string"}},"duration_ms":{"type":"array","items":{"type":"integer"}}}},"branch_chosen":{"type":"object","properties":{"type":{"type":"string","enum":["branch","default"]},"branch":{"type":"integer"}},"required":["type"]},"branchall":{"type":"object","properties":{"branch":{"type":"integer"},"len":{"type":"integer"}},"required":["branch","len"]},"approvers":{"type":"array","items":{"type":"object","properties":{"resume_id":{"type":"integer"},"approver":{"type":"string"}},"required":["resume_id","approver"]}},"failed_retries":{"type":"array","items":{"type":"string","format":"uuid"}},"skipped":{"type":"boolean"},"agent_actions":{"type":"array","items":{"type":"object","oneOf":[{"type":"object","properties":{"job_id":{"type":"string","format":"uuid"},"function_name":{"type":"string"},"type":{"type":"string","enum":["tool_call"]},"module_id":{"type":"string"}},"required":["job_id","function_name","type","module_id"]},{"type":"object","properties":{"call_id":{"type":"string","format":"uuid"},"function_name":{"type":"string"},"resource_path":{"type":"string"},"type":{"type":"string","enum":["mcp_tool_call"]},"arguments":{"type":"object"}},"required":["call_id","function_name","resource_path","type"]},{"type":"object","properties":{"type":{"type":"string","enum":["web_search"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["message"]}},"required":["content","type"]}]}},"agent_actions_success":{"type":"array","items":{"type":"boolean"}}},"required":["type"]}}`;
|
|
1204
1369
|
export const CLI_COMMANDS = `# Windmill CLI Commands
|
|
1205
1370
|
|
|
1206
1371
|
The Windmill CLI (\`wmill\`) provides commands for managing scripts, flows, apps, and other resources.
|
|
1207
1372
|
|
|
1208
|
-
Current version: 1.624.0
|
|
1209
|
-
|
|
1210
1373
|
## Global Options
|
|
1211
1374
|
|
|
1212
1375
|
- \`--workspace <workspace:string>\` - Specify the target workspace. This overrides the default workspace.
|
|
@@ -1222,8 +1385,15 @@ Current version: 1.624.0
|
|
|
1222
1385
|
|
|
1223
1386
|
app related commands
|
|
1224
1387
|
|
|
1388
|
+
**Options:**
|
|
1389
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1390
|
+
|
|
1225
1391
|
**Subcommands:**
|
|
1226
1392
|
|
|
1393
|
+
- \`app list\` - list all apps
|
|
1394
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1395
|
+
- \`app get <path:string>\` - get an app's details
|
|
1396
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1227
1397
|
- \`app push <file_path:string> <remote_path:string>\` - push a local app
|
|
1228
1398
|
- \`app dev [app_folder:string]\` - Start a development server for building apps with live reload and hot module replacement
|
|
1229
1399
|
- \`--port <port:number>\` - Port to run the dev server on (will find next available port if occupied)
|
|
@@ -1256,15 +1426,30 @@ Launch a dev server that will spawn a webserver with HMR
|
|
|
1256
1426
|
**Options:**
|
|
1257
1427
|
- \`--includes <pattern...:string>\` - Filter paths givena glob pattern or path
|
|
1258
1428
|
|
|
1429
|
+
### docs
|
|
1430
|
+
|
|
1431
|
+
Search Windmill documentation. Requires Enterprise Edition.
|
|
1432
|
+
|
|
1433
|
+
**Arguments:** \`<query:string>\`
|
|
1434
|
+
|
|
1435
|
+
**Options:**
|
|
1436
|
+
- \`--json\` - Output results as JSON.
|
|
1437
|
+
|
|
1259
1438
|
### flow
|
|
1260
1439
|
|
|
1261
1440
|
flow related commands
|
|
1262
1441
|
|
|
1263
1442
|
**Options:**
|
|
1264
|
-
- \`--show-archived\` - Enable archived
|
|
1443
|
+
- \`--show-archived\` - Enable archived flows in output
|
|
1444
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1265
1445
|
|
|
1266
1446
|
**Subcommands:**
|
|
1267
1447
|
|
|
1448
|
+
- \`flow list\` - list all flows
|
|
1449
|
+
- \`--show-archived\` - Enable archived flows in output
|
|
1450
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1451
|
+
- \`flow get <path:string>\` - get a flow's details
|
|
1452
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1268
1453
|
- \`flow push <file_path:string> <remote_path:string>\` - push a local flow spec. This overrides any remote versions.
|
|
1269
1454
|
- \`flow run <path:string>\` - run a flow by path.
|
|
1270
1455
|
- \`-d --data <data:string>\` - Inputs specified as a JSON string or a file using @<filename> or stdin using @-.
|
|
@@ -1276,17 +1461,31 @@ flow related commands
|
|
|
1276
1461
|
- \`--yes\` - Skip confirmation prompt
|
|
1277
1462
|
- \`-i --includes <patterns:file[]>\` - Comma separated patterns to specify which file to take into account (among files that are compatible with windmill). Patterns can include * (any string until '/') and ** (any string)
|
|
1278
1463
|
- \`-e --excludes <patterns:file[]>\` - Comma separated patterns to specify which file to NOT take into account.
|
|
1279
|
-
- \`flow
|
|
1280
|
-
- \`--summary <summary:string>\` -
|
|
1281
|
-
- \`--description <description:string>\` -
|
|
1464
|
+
- \`flow new <flow_path:string>\` - create a new empty flow
|
|
1465
|
+
- \`--summary <summary:string>\` - flow summary
|
|
1466
|
+
- \`--description <description:string>\` - flow description
|
|
1467
|
+
- \`flow bootstrap <flow_path:string>\` - create a new empty flow (alias for new
|
|
1468
|
+
- \`--summary <summary:string>\` - flow summary
|
|
1469
|
+
- \`--description <description:string>\` - flow description
|
|
1282
1470
|
|
|
1283
1471
|
### folder
|
|
1284
1472
|
|
|
1285
1473
|
folder related commands
|
|
1286
1474
|
|
|
1475
|
+
**Options:**
|
|
1476
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1477
|
+
|
|
1287
1478
|
**Subcommands:**
|
|
1288
1479
|
|
|
1289
|
-
- \`folder
|
|
1480
|
+
- \`folder list\` - list all folders
|
|
1481
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1482
|
+
- \`folder get <name:string>\` - get a folder's details
|
|
1483
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1484
|
+
- \`folder new <name:string>\` - create a new folder locally
|
|
1485
|
+
- \`--summary <summary:string>\` - folder summary
|
|
1486
|
+
- \`folder push <name:string>\` - push a local folder to the remote by name. This overrides any remote versions.
|
|
1487
|
+
- \`folder add-missing\` - create default folder.meta.yaml for all subdirectories of f/ that are missing one
|
|
1488
|
+
- \`-y, --yes\` - skip confirmation prompt
|
|
1290
1489
|
|
|
1291
1490
|
### gitsync-settings
|
|
1292
1491
|
|
|
@@ -1365,6 +1564,9 @@ sync local with a remote instance or the opposite (push or pull)
|
|
|
1365
1564
|
- \`--prefix <prefix:string>\` - Prefix of the local workspaces folders to push
|
|
1366
1565
|
- \`--prefix-settings\` - Store instance yamls inside prefixed folders when using --prefix and --folder-per-instance
|
|
1367
1566
|
- \`instance whoami\` - Display information about the currently logged-in user
|
|
1567
|
+
- \`instance get-config\` - Dump the current instance config (global settings + worker configs) as YAML
|
|
1568
|
+
- \`-o, --output-file <file:string>\` - Write YAML to a file instead of stdout
|
|
1569
|
+
- \`--instance <instance:string>\` - Name of the instance, override the active instance
|
|
1368
1570
|
|
|
1369
1571
|
### jobs
|
|
1370
1572
|
|
|
@@ -1382,6 +1584,17 @@ Pull completed and queued jobs from workspace
|
|
|
1382
1584
|
- \`jobs pull\`
|
|
1383
1585
|
- \`jobs push\`
|
|
1384
1586
|
|
|
1587
|
+
### lint
|
|
1588
|
+
|
|
1589
|
+
Validate Windmill flow, schedule, and trigger YAML files in a directory
|
|
1590
|
+
|
|
1591
|
+
**Arguments:** \`[directory:string]\`
|
|
1592
|
+
|
|
1593
|
+
**Options:**
|
|
1594
|
+
- \`--json\` - Output results in JSON format
|
|
1595
|
+
- \`--fail-on-warn\` - Exit with code 1 when warnings are emitted
|
|
1596
|
+
- \`--locks-required\` - Fail if scripts or flow inline scripts that need locks have no locks
|
|
1597
|
+
|
|
1385
1598
|
### queues
|
|
1386
1599
|
|
|
1387
1600
|
List all queues with their metrics
|
|
@@ -1396,18 +1609,33 @@ List all queues with their metrics
|
|
|
1396
1609
|
|
|
1397
1610
|
resource related commands
|
|
1398
1611
|
|
|
1612
|
+
**Options:**
|
|
1613
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1614
|
+
|
|
1399
1615
|
**Subcommands:**
|
|
1400
1616
|
|
|
1617
|
+
- \`resource list\` - list all resources
|
|
1618
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1619
|
+
- \`resource get <path:string>\` - get a resource's details
|
|
1620
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1621
|
+
- \`resource new <path:string>\` - create a new resource locally
|
|
1401
1622
|
- \`resource push <file_path:string> <remote_path:string>\` - push a local resource spec. This overrides any remote versions.
|
|
1402
1623
|
|
|
1403
1624
|
### resource-type
|
|
1404
1625
|
|
|
1405
1626
|
resource type related commands
|
|
1406
1627
|
|
|
1628
|
+
**Options:**
|
|
1629
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1630
|
+
|
|
1407
1631
|
**Subcommands:**
|
|
1408
1632
|
|
|
1409
1633
|
- \`resource-type list\` - list all resource types
|
|
1410
1634
|
- \`--schema\` - Show schema in the output
|
|
1635
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1636
|
+
- \`resource-type get <path:string>\` - get a resource type's details
|
|
1637
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1638
|
+
- \`resource-type new <name:string>\` - create a new resource type locally
|
|
1411
1639
|
- \`resource-type push <file_path:string> <name:string>\` - push a local resource spec. This overrides any remote versions.
|
|
1412
1640
|
- \`resource-type generate-namespace\` - Create a TypeScript definition file with the RT namespace generated from the resource types
|
|
1413
1641
|
|
|
@@ -1415,8 +1643,16 @@ resource type related commands
|
|
|
1415
1643
|
|
|
1416
1644
|
schedule related commands
|
|
1417
1645
|
|
|
1646
|
+
**Options:**
|
|
1647
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1648
|
+
|
|
1418
1649
|
**Subcommands:**
|
|
1419
1650
|
|
|
1651
|
+
- \`schedule list\` - list all schedules
|
|
1652
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1653
|
+
- \`schedule get <path:string>\` - get a schedule's details
|
|
1654
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1655
|
+
- \`schedule new <path:string>\` - create a new schedule locally
|
|
1420
1656
|
- \`schedule push <file_path:string> <remote_path:string>\` - push a local schedule spec. This overrides any remote versions.
|
|
1421
1657
|
|
|
1422
1658
|
### script
|
|
@@ -1425,18 +1661,27 @@ script related commands
|
|
|
1425
1661
|
|
|
1426
1662
|
**Options:**
|
|
1427
1663
|
- \`--show-archived\` - Enable archived scripts in output
|
|
1664
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1428
1665
|
|
|
1429
1666
|
**Subcommands:**
|
|
1430
1667
|
|
|
1668
|
+
- \`script list\` - list all scripts
|
|
1669
|
+
- \`--show-archived\` - Enable archived scripts in output
|
|
1670
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1431
1671
|
- \`script push <path:file>\` - push a local script spec. This overrides any remote versions. Use the script file (.ts, .js, .py, .sh
|
|
1432
|
-
- \`script
|
|
1672
|
+
- \`script get <path:file>\` - get a script's details
|
|
1673
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1674
|
+
- \`script show <path:file>\` - show a script's content (alias for get
|
|
1433
1675
|
- \`script run <path:file>\` - run a script by path
|
|
1434
1676
|
- \`-d --data <data:file>\` - Inputs specified as a JSON string or a file using @<filename> or stdin using @-.
|
|
1435
1677
|
- \`-s --silent\` - Do not output anything other then the final output. Useful for scripting.
|
|
1436
1678
|
- \`script preview <path:file>\` - preview a local script without deploying it. Supports both regular and codebase scripts.
|
|
1437
1679
|
- \`-d --data <data:file>\` - Inputs specified as a JSON string or a file using @<filename> or stdin using @-.
|
|
1438
1680
|
- \`-s --silent\` - Do not output anything other than the final output. Useful for scripting.
|
|
1439
|
-
- \`script
|
|
1681
|
+
- \`script new <path:file> <language:string>\` - create a new script
|
|
1682
|
+
- \`--summary <summary:string>\` - script summary
|
|
1683
|
+
- \`--description <description:string>\` - script description
|
|
1684
|
+
- \`script bootstrap <path:file> <language:string>\` - create a new script (alias for new
|
|
1440
1685
|
- \`--summary <summary:string>\` - script summary
|
|
1441
1686
|
- \`--description <description:string>\` - script description
|
|
1442
1687
|
- \`script generate-metadata [script:file]\` - re-generate the metadata file updating the lock and the script schema (for flows, use \`wmill flow generate-locks\`
|
|
@@ -1512,13 +1757,25 @@ sync local with a remote workspaces or the opposite (push or pull)
|
|
|
1512
1757
|
- \`--parallel <number>\` - Number of changes to process in parallel
|
|
1513
1758
|
- \`--repository <repo:string>\` - Specify repository path (e.g., u/user/repo) when multiple repositories exist
|
|
1514
1759
|
- \`--branch <branch:string>\` - Override the current git branch (works even outside a git repository)
|
|
1760
|
+
- \`--lint\` - Run lint validation before pushing
|
|
1761
|
+
- \`--locks-required\` - Fail if scripts or flow inline scripts that need locks have no locks
|
|
1515
1762
|
|
|
1516
1763
|
### trigger
|
|
1517
1764
|
|
|
1518
1765
|
trigger related commands
|
|
1519
1766
|
|
|
1767
|
+
**Options:**
|
|
1768
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1769
|
+
|
|
1520
1770
|
**Subcommands:**
|
|
1521
1771
|
|
|
1772
|
+
- \`trigger list\` - list all triggers
|
|
1773
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1774
|
+
- \`trigger get <path:string>\` - get a trigger's details
|
|
1775
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1776
|
+
- \`--kind <kind:string>\` - Trigger kind (http, websocket, kafka, nats, postgres, mqtt, sqs, gcp, email). Recommended for faster lookup
|
|
1777
|
+
- \`trigger new <path:string>\` - create a new trigger locally
|
|
1778
|
+
- \`--kind <kind:string>\` - Trigger kind (required: http, websocket, kafka, nats, postgres, mqtt, sqs, gcp, email)
|
|
1522
1779
|
- \`trigger push <file_path:string> <remote_path:string>\` - push a local trigger spec. This overrides any remote versions.
|
|
1523
1780
|
|
|
1524
1781
|
### user
|
|
@@ -1540,8 +1797,16 @@ user related commands
|
|
|
1540
1797
|
|
|
1541
1798
|
variable related commands
|
|
1542
1799
|
|
|
1800
|
+
**Options:**
|
|
1801
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1802
|
+
|
|
1543
1803
|
**Subcommands:**
|
|
1544
1804
|
|
|
1805
|
+
- \`variable list\` - list all variables
|
|
1806
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1807
|
+
- \`variable get <path:string>\` - get a variable's details
|
|
1808
|
+
- \`--json\` - Output as JSON (for piping to jq)
|
|
1809
|
+
- \`variable new <path:string>\` - create a new variable locally
|
|
1545
1810
|
- \`variable push <file_path:string> <remote_path:string>\` - Push a local variable spec. This overrides any remote versions.
|
|
1546
1811
|
- \`--plain-secrets\` - Push secrets as plain text
|
|
1547
1812
|
- \`variable add <value:string> <remote_path:string>\` - Create a new variable on the remote. This will update the variable if it already exists.
|
|
@@ -1590,7 +1855,8 @@ workspace related commands
|
|
|
1590
1855
|
- \`--create-username <username:string>\` - Specify your own username in the newly created workspace. Ignored if --create is not specified, the workspace already exists or automatic username creation is enabled on the instance.
|
|
1591
1856
|
- \`workspace remove <workspace_name:string>\` - Remove a workspace
|
|
1592
1857
|
- \`workspace whoami\` - Show the currently active user
|
|
1593
|
-
- \`workspace list\` - List
|
|
1858
|
+
- \`workspace list\` - List local workspace profiles
|
|
1859
|
+
- \`workspace list-remote\` - List workspaces on the remote server that you have access to
|
|
1594
1860
|
- \`workspace bind\` - Bind the current Git branch to the active workspace
|
|
1595
1861
|
- \`--branch <branch:string>\` - Specify branch (defaults to current)
|
|
1596
1862
|
- \`workspace unbind\` - Remove workspace binding from the current Git branch
|
|
@@ -1601,123 +1867,66 @@ workspace related commands
|
|
|
1601
1867
|
- \`-y --yes\` - Skip confirmation prompt
|
|
1602
1868
|
|
|
1603
1869
|
`;
|
|
1604
|
-
export const
|
|
1870
|
+
export const LANG_BASH = `# Bash
|
|
1605
1871
|
|
|
1606
1872
|
## Structure
|
|
1607
1873
|
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
\`\`\`python
|
|
1611
|
-
def main(param1: str, param2: int):
|
|
1612
|
-
# Your code here
|
|
1613
|
-
return {"result": param1, "count": param2}
|
|
1614
|
-
\`\`\`
|
|
1615
|
-
|
|
1616
|
-
Do not call the main function. Libraries are installed automatically.
|
|
1617
|
-
|
|
1618
|
-
## Resource Types
|
|
1619
|
-
|
|
1620
|
-
On Windmill, credentials and configuration are stored in resources and passed as parameters to main.
|
|
1621
|
-
|
|
1622
|
-
You need to **redefine** the type of the resources that are needed before the main function as TypedDict:
|
|
1623
|
-
|
|
1624
|
-
\`\`\`python
|
|
1625
|
-
from typing import TypedDict
|
|
1626
|
-
|
|
1627
|
-
class postgresql(TypedDict):
|
|
1628
|
-
host: str
|
|
1629
|
-
port: int
|
|
1630
|
-
user: str
|
|
1631
|
-
password: str
|
|
1632
|
-
dbname: str
|
|
1633
|
-
|
|
1634
|
-
def main(db: postgresql):
|
|
1635
|
-
# db contains the database connection details
|
|
1636
|
-
pass
|
|
1637
|
-
\`\`\`
|
|
1638
|
-
|
|
1639
|
-
**Important rules:**
|
|
1640
|
-
|
|
1641
|
-
- The resource type name must be **IN LOWERCASE**
|
|
1642
|
-
- Only include resource types if they are actually needed
|
|
1643
|
-
- If an import conflicts with a resource type name, **rename the imported object, not the type name**
|
|
1644
|
-
- Make sure to import TypedDict from typing **if you're using it**
|
|
1874
|
+
Do not include \`#!/bin/bash\`. Arguments are obtained as positional parameters:
|
|
1645
1875
|
|
|
1646
|
-
|
|
1876
|
+
\`\`\`bash
|
|
1877
|
+
# Get arguments
|
|
1878
|
+
var1="$1"
|
|
1879
|
+
var2="$2"
|
|
1647
1880
|
|
|
1648
|
-
|
|
1881
|
+
echo "Processing $var1 and $var2"
|
|
1649
1882
|
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
import pandas as pd
|
|
1653
|
-
from datetime import datetime
|
|
1883
|
+
# Return JSON by echoing to stdout
|
|
1884
|
+
echo "{\\"result\\": \\"$var1\\", \\"count\\": $var2}"
|
|
1654
1885
|
\`\`\`
|
|
1655
1886
|
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
import stripe as stripe_lib
|
|
1661
|
-
class stripe_type(TypedDict): ...
|
|
1887
|
+
**Important:**
|
|
1888
|
+
- Do not include shebang (\`#!/bin/bash\`)
|
|
1889
|
+
- Arguments are always strings
|
|
1890
|
+
- Access with \`$1\`, \`$2\`, etc.
|
|
1662
1891
|
|
|
1663
|
-
|
|
1664
|
-
import stripe as stripe_sdk
|
|
1665
|
-
class stripe(TypedDict):
|
|
1666
|
-
api_key: str
|
|
1667
|
-
\`\`\`
|
|
1892
|
+
## Output
|
|
1668
1893
|
|
|
1669
|
-
|
|
1894
|
+
The script output is captured as the result. For structured data, output valid JSON:
|
|
1670
1895
|
|
|
1671
|
-
|
|
1896
|
+
\`\`\`bash
|
|
1897
|
+
name="$1"
|
|
1898
|
+
count="$2"
|
|
1672
1899
|
|
|
1673
|
-
|
|
1674
|
-
|
|
1900
|
+
# Output JSON result
|
|
1901
|
+
cat << EOF
|
|
1902
|
+
{
|
|
1903
|
+
"name": "$name",
|
|
1904
|
+
"count": $count,
|
|
1905
|
+
"timestamp": "$(date -Iseconds)"
|
|
1906
|
+
}
|
|
1907
|
+
EOF
|
|
1675
1908
|
\`\`\`
|
|
1676
1909
|
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
## Preprocessor Scripts
|
|
1680
|
-
|
|
1681
|
-
For preprocessor scripts, the function should be named \`preprocessor\` and receives an \`event\` parameter:
|
|
1682
|
-
|
|
1683
|
-
\`\`\`python
|
|
1684
|
-
from typing import TypedDict, Literal, Any
|
|
1910
|
+
## Environment Variables
|
|
1685
1911
|
|
|
1686
|
-
|
|
1687
|
-
kind: Literal["webhook", "http", "websocket", "kafka", "email", "nats", "postgres", "sqs", "mqtt", "gcp"]
|
|
1688
|
-
body: Any
|
|
1689
|
-
headers: dict[str, str]
|
|
1690
|
-
query: dict[str, str]
|
|
1912
|
+
Environment variables set in Windmill are available:
|
|
1691
1913
|
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
"param2": event["query"]["id"]
|
|
1697
|
-
}
|
|
1914
|
+
\`\`\`bash
|
|
1915
|
+
# Access environment variable
|
|
1916
|
+
echo "Workspace: $WM_WORKSPACE"
|
|
1917
|
+
echo "Job ID: $WM_JOB_ID"
|
|
1698
1918
|
\`\`\`
|
|
1919
|
+
`;
|
|
1920
|
+
export const LANG_BIGQUERY = `# BigQuery
|
|
1699
1921
|
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
Windmill provides built-in support for S3-compatible storage operations.
|
|
1703
|
-
|
|
1704
|
-
\`\`\`python
|
|
1705
|
-
import wmill
|
|
1706
|
-
|
|
1707
|
-
# Load file content from S3
|
|
1708
|
-
content: bytes = wmill.load_s3_file(s3object)
|
|
1922
|
+
Arguments use \`@name\` syntax.
|
|
1709
1923
|
|
|
1710
|
-
|
|
1711
|
-
reader: BufferedReader = wmill.load_s3_file_reader(s3object)
|
|
1924
|
+
Name the parameters by adding comments before the statement:
|
|
1712
1925
|
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
s3_resource_path, # Optional: specific S3 resource
|
|
1718
|
-
content_type, # Optional: MIME type
|
|
1719
|
-
content_disposition # Optional: Content-Disposition header
|
|
1720
|
-
)
|
|
1926
|
+
\`\`\`sql
|
|
1927
|
+
-- @name1 (string)
|
|
1928
|
+
-- @name2 (int64) = 0
|
|
1929
|
+
SELECT * FROM users WHERE name = @name1 AND age > @name2;
|
|
1721
1930
|
\`\`\`
|
|
1722
1931
|
`;
|
|
1723
1932
|
export const LANG_BUN = `# TypeScript (Bun)
|
|
@@ -1751,6 +1960,8 @@ export async function main(stripe: RT.Stripe) {
|
|
|
1751
1960
|
|
|
1752
1961
|
Only use resource types if you need them to satisfy the instructions. Always use the RT namespace.
|
|
1753
1962
|
|
|
1963
|
+
Before using a resource type, check the \`rt.d.ts\` file in the project root to see all available resource types and their fields. This file is generated by \`wmill resource-type generate-namespace\`.
|
|
1964
|
+
|
|
1754
1965
|
## Imports
|
|
1755
1966
|
|
|
1756
1967
|
\`\`\`typescript
|
|
@@ -1831,150 +2042,11 @@ const result: S3Object = await wmill.writeS3File(
|
|
|
1831
2042
|
);
|
|
1832
2043
|
\`\`\`
|
|
1833
2044
|
`;
|
|
1834
|
-
export const
|
|
2045
|
+
export const LANG_BUNNATIVE = `# TypeScript (Bun Native)
|
|
1835
2046
|
|
|
1836
|
-
|
|
2047
|
+
Native TypeScript execution with fetch only - no external imports allowed.
|
|
1837
2048
|
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
\`\`\`sql
|
|
1841
|
-
-- ? name1 (text)
|
|
1842
|
-
-- ? name2 (int) = 0
|
|
1843
|
-
SELECT * FROM users WHERE name = ? AND age > ?;
|
|
1844
|
-
\`\`\`
|
|
1845
|
-
`;
|
|
1846
|
-
export const LANG_POWERSHELL = `# PowerShell
|
|
1847
|
-
|
|
1848
|
-
## Structure
|
|
1849
|
-
|
|
1850
|
-
Arguments are obtained by calling the \`param\` function on the first line:
|
|
1851
|
-
|
|
1852
|
-
\`\`\`powershell
|
|
1853
|
-
param($Name, $Count = 0, [int]$Age)
|
|
1854
|
-
|
|
1855
|
-
# Your code here
|
|
1856
|
-
Write-Output "Processing $Name, count: $Count, age: $Age"
|
|
1857
|
-
|
|
1858
|
-
# Return object
|
|
1859
|
-
@{
|
|
1860
|
-
name = $Name
|
|
1861
|
-
count = $Count
|
|
1862
|
-
age = $Age
|
|
1863
|
-
}
|
|
1864
|
-
\`\`\`
|
|
1865
|
-
|
|
1866
|
-
## Parameter Types
|
|
1867
|
-
|
|
1868
|
-
You can specify types for parameters:
|
|
1869
|
-
|
|
1870
|
-
\`\`\`powershell
|
|
1871
|
-
param(
|
|
1872
|
-
[string]$Name,
|
|
1873
|
-
[int]$Count = 0,
|
|
1874
|
-
[bool]$Enabled = $true,
|
|
1875
|
-
[array]$Items
|
|
1876
|
-
)
|
|
1877
|
-
|
|
1878
|
-
@{
|
|
1879
|
-
name = $Name
|
|
1880
|
-
count = $Count
|
|
1881
|
-
enabled = $Enabled
|
|
1882
|
-
items = $Items
|
|
1883
|
-
}
|
|
1884
|
-
\`\`\`
|
|
1885
|
-
|
|
1886
|
-
## Return Values
|
|
1887
|
-
|
|
1888
|
-
Return values by outputting them at the end of the script:
|
|
1889
|
-
|
|
1890
|
-
\`\`\`powershell
|
|
1891
|
-
param($Input)
|
|
1892
|
-
|
|
1893
|
-
$result = @{
|
|
1894
|
-
processed = $true
|
|
1895
|
-
data = $Input
|
|
1896
|
-
timestamp = Get-Date -Format "o"
|
|
1897
|
-
}
|
|
1898
|
-
|
|
1899
|
-
$result
|
|
1900
|
-
\`\`\`
|
|
1901
|
-
`;
|
|
1902
|
-
export const LANG_SNOWFLAKE = `# Snowflake
|
|
1903
|
-
|
|
1904
|
-
Arguments use \`?\` placeholders.
|
|
1905
|
-
|
|
1906
|
-
Name the parameters by adding comments before the statement:
|
|
1907
|
-
|
|
1908
|
-
\`\`\`sql
|
|
1909
|
-
-- ? name1 (text)
|
|
1910
|
-
-- ? name2 (number) = 0
|
|
1911
|
-
SELECT * FROM users WHERE name = ? AND age > ?;
|
|
1912
|
-
\`\`\`
|
|
1913
|
-
`;
|
|
1914
|
-
export const LANG_GO = `# Go
|
|
1915
|
-
|
|
1916
|
-
## Structure
|
|
1917
|
-
|
|
1918
|
-
The file package must be \`inner\` and export a function called \`main\`:
|
|
1919
|
-
|
|
1920
|
-
\`\`\`go
|
|
1921
|
-
package inner
|
|
1922
|
-
|
|
1923
|
-
func main(param1 string, param2 int) (map[string]interface{}, error) {
|
|
1924
|
-
return map[string]interface{}{
|
|
1925
|
-
"result": param1,
|
|
1926
|
-
"count": param2,
|
|
1927
|
-
}, nil
|
|
1928
|
-
}
|
|
1929
|
-
\`\`\`
|
|
1930
|
-
|
|
1931
|
-
**Important:**
|
|
1932
|
-
- Package must be \`inner\`
|
|
1933
|
-
- Return type must be \`({return_type}, error)\`
|
|
1934
|
-
- Function name is \`main\` (lowercase)
|
|
1935
|
-
|
|
1936
|
-
## Return Types
|
|
1937
|
-
|
|
1938
|
-
The return type can be any Go type that can be serialized to JSON:
|
|
1939
|
-
|
|
1940
|
-
\`\`\`go
|
|
1941
|
-
package inner
|
|
1942
|
-
|
|
1943
|
-
type Result struct {
|
|
1944
|
-
Name string \`json:"name"\`
|
|
1945
|
-
Count int \`json:"count"\`
|
|
1946
|
-
}
|
|
1947
|
-
|
|
1948
|
-
func main(name string, count int) (Result, error) {
|
|
1949
|
-
return Result{
|
|
1950
|
-
Name: name,
|
|
1951
|
-
Count: count,
|
|
1952
|
-
}, nil
|
|
1953
|
-
}
|
|
1954
|
-
\`\`\`
|
|
1955
|
-
|
|
1956
|
-
## Error Handling
|
|
1957
|
-
|
|
1958
|
-
Return errors as the second return value:
|
|
1959
|
-
|
|
1960
|
-
\`\`\`go
|
|
1961
|
-
package inner
|
|
1962
|
-
|
|
1963
|
-
import "errors"
|
|
1964
|
-
|
|
1965
|
-
func main(value int) (string, error) {
|
|
1966
|
-
if value < 0 {
|
|
1967
|
-
return "", errors.New("value must be positive")
|
|
1968
|
-
}
|
|
1969
|
-
return "success", nil
|
|
1970
|
-
}
|
|
1971
|
-
\`\`\`
|
|
1972
|
-
`;
|
|
1973
|
-
export const LANG_DENO = `# TypeScript (Deno)
|
|
1974
|
-
|
|
1975
|
-
Deno runtime with npm support via \`npm:\` prefix and native Deno libraries.
|
|
1976
|
-
|
|
1977
|
-
## Structure
|
|
2049
|
+
## Structure
|
|
1978
2050
|
|
|
1979
2051
|
Export a single **async** function called \`main\`:
|
|
1980
2052
|
|
|
@@ -1985,7 +2057,7 @@ export async function main(param1: string, param2: number) {
|
|
|
1985
2057
|
}
|
|
1986
2058
|
\`\`\`
|
|
1987
2059
|
|
|
1988
|
-
Do not call the main function.
|
|
2060
|
+
Do not call the main function.
|
|
1989
2061
|
|
|
1990
2062
|
## Resource Types
|
|
1991
2063
|
|
|
@@ -2001,26 +2073,22 @@ export async function main(stripe: RT.Stripe) {
|
|
|
2001
2073
|
|
|
2002
2074
|
Only use resource types if you need them to satisfy the instructions. Always use the RT namespace.
|
|
2003
2075
|
|
|
2076
|
+
Before using a resource type, check the \`rt.d.ts\` file in the project root to see all available resource types and their fields. This file is generated by \`wmill resource-type generate-namespace\`.
|
|
2077
|
+
|
|
2004
2078
|
## Imports
|
|
2005
2079
|
|
|
2006
|
-
|
|
2007
|
-
// npm packages use npm: prefix
|
|
2008
|
-
import Stripe from "npm:stripe";
|
|
2009
|
-
import { someFunction } from "npm:some-package";
|
|
2080
|
+
**No imports allowed.** Use the globally available \`fetch\` function:
|
|
2010
2081
|
|
|
2011
|
-
|
|
2012
|
-
|
|
2082
|
+
\`\`\`typescript
|
|
2083
|
+
export async function main(url: string) {
|
|
2084
|
+
const response = await fetch(url);
|
|
2085
|
+
return await response.json();
|
|
2086
|
+
}
|
|
2013
2087
|
\`\`\`
|
|
2014
2088
|
|
|
2015
2089
|
## Windmill Client
|
|
2016
2090
|
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
\`\`\`typescript
|
|
2020
|
-
import * as wmill from "windmill-client";
|
|
2021
|
-
\`\`\`
|
|
2022
|
-
|
|
2023
|
-
See the SDK documentation for available methods.
|
|
2091
|
+
The windmill client is not available in native TypeScript mode. Use fetch to call APIs directly.
|
|
2024
2092
|
|
|
2025
2093
|
## Preprocessor Scripts
|
|
2026
2094
|
|
|
@@ -2085,59 +2153,51 @@ const result: S3Object = await wmill.writeS3File(
|
|
|
2085
2153
|
);
|
|
2086
2154
|
\`\`\`
|
|
2087
2155
|
`;
|
|
2088
|
-
export const
|
|
2089
|
-
|
|
2090
|
-
## Structure
|
|
2091
|
-
|
|
2092
|
-
Do not include \`#!/bin/bash\`. Arguments are obtained as positional parameters:
|
|
2093
|
-
|
|
2094
|
-
\`\`\`bash
|
|
2095
|
-
# Get arguments
|
|
2096
|
-
var1="$1"
|
|
2097
|
-
var2="$2"
|
|
2156
|
+
export const LANG_CSHARP = `# C#
|
|
2098
2157
|
|
|
2099
|
-
|
|
2158
|
+
The script must contain a public static \`Main\` method inside a class:
|
|
2100
2159
|
|
|
2101
|
-
|
|
2102
|
-
|
|
2160
|
+
\`\`\`csharp
|
|
2161
|
+
public class Script
|
|
2162
|
+
{
|
|
2163
|
+
public static object Main(string name, int count)
|
|
2164
|
+
{
|
|
2165
|
+
return new { Name = name, Count = count };
|
|
2166
|
+
}
|
|
2167
|
+
}
|
|
2103
2168
|
\`\`\`
|
|
2104
2169
|
|
|
2105
2170
|
**Important:**
|
|
2106
|
-
-
|
|
2107
|
-
-
|
|
2108
|
-
-
|
|
2171
|
+
- Class name is irrelevant
|
|
2172
|
+
- Method must be \`public static\`
|
|
2173
|
+
- Return type can be \`object\` or specific type
|
|
2109
2174
|
|
|
2110
|
-
##
|
|
2175
|
+
## NuGet Packages
|
|
2111
2176
|
|
|
2112
|
-
|
|
2177
|
+
Add packages using the \`#r\` directive at the top:
|
|
2113
2178
|
|
|
2114
|
-
\`\`\`
|
|
2115
|
-
|
|
2116
|
-
|
|
2179
|
+
\`\`\`csharp
|
|
2180
|
+
#r "nuget: Newtonsoft.Json, 13.0.3"
|
|
2181
|
+
#r "nuget: RestSharp, 110.2.0"
|
|
2117
2182
|
|
|
2118
|
-
|
|
2119
|
-
|
|
2183
|
+
using Newtonsoft.Json;
|
|
2184
|
+
using RestSharp;
|
|
2185
|
+
|
|
2186
|
+
public class Script
|
|
2120
2187
|
{
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2188
|
+
public static object Main(string url)
|
|
2189
|
+
{
|
|
2190
|
+
var client = new RestClient(url);
|
|
2191
|
+
var request = new RestRequest();
|
|
2192
|
+
var response = client.Get(request);
|
|
2193
|
+
return JsonConvert.DeserializeObject(response.Content);
|
|
2194
|
+
}
|
|
2124
2195
|
}
|
|
2125
|
-
EOF
|
|
2126
|
-
\`\`\`
|
|
2127
|
-
|
|
2128
|
-
## Environment Variables
|
|
2129
|
-
|
|
2130
|
-
Environment variables set in Windmill are available:
|
|
2131
|
-
|
|
2132
|
-
\`\`\`bash
|
|
2133
|
-
# Access environment variable
|
|
2134
|
-
echo "Workspace: $WM_WORKSPACE"
|
|
2135
|
-
echo "Job ID: $WM_JOB_ID"
|
|
2136
2196
|
\`\`\`
|
|
2137
2197
|
`;
|
|
2138
|
-
export const
|
|
2198
|
+
export const LANG_DENO = `# TypeScript (Deno)
|
|
2139
2199
|
|
|
2140
|
-
|
|
2200
|
+
Deno runtime with npm support via \`npm:\` prefix and native Deno libraries.
|
|
2141
2201
|
|
|
2142
2202
|
## Structure
|
|
2143
2203
|
|
|
@@ -2150,7 +2210,7 @@ export async function main(param1: string, param2: number) {
|
|
|
2150
2210
|
}
|
|
2151
2211
|
\`\`\`
|
|
2152
2212
|
|
|
2153
|
-
Do not call the main function.
|
|
2213
|
+
Do not call the main function. Libraries are installed automatically.
|
|
2154
2214
|
|
|
2155
2215
|
## Resource Types
|
|
2156
2216
|
|
|
@@ -2166,20 +2226,28 @@ export async function main(stripe: RT.Stripe) {
|
|
|
2166
2226
|
|
|
2167
2227
|
Only use resource types if you need them to satisfy the instructions. Always use the RT namespace.
|
|
2168
2228
|
|
|
2169
|
-
|
|
2229
|
+
Before using a resource type, check the \`rt.d.ts\` file in the project root to see all available resource types and their fields. This file is generated by \`wmill resource-type generate-namespace\`.
|
|
2170
2230
|
|
|
2171
|
-
|
|
2231
|
+
## Imports
|
|
2172
2232
|
|
|
2173
2233
|
\`\`\`typescript
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2234
|
+
// npm packages use npm: prefix
|
|
2235
|
+
import Stripe from "npm:stripe";
|
|
2236
|
+
import { someFunction } from "npm:some-package";
|
|
2237
|
+
|
|
2238
|
+
// Deno standard library
|
|
2239
|
+
import { serve } from "https://deno.land/std/http/server.ts";
|
|
2178
2240
|
\`\`\`
|
|
2179
2241
|
|
|
2180
2242
|
## Windmill Client
|
|
2181
2243
|
|
|
2182
|
-
|
|
2244
|
+
Import the windmill client for platform interactions:
|
|
2245
|
+
|
|
2246
|
+
\`\`\`typescript
|
|
2247
|
+
import * as wmill from "windmill-client";
|
|
2248
|
+
\`\`\`
|
|
2249
|
+
|
|
2250
|
+
See the SDK documentation for available methods.
|
|
2183
2251
|
|
|
2184
2252
|
## Preprocessor Scripts
|
|
2185
2253
|
|
|
@@ -2296,7 +2364,175 @@ SELECT * FROM read_parquet('s3:///path/to/file.parquet');
|
|
|
2296
2364
|
SELECT * FROM read_json('s3:///path/to/file.json');
|
|
2297
2365
|
\`\`\`
|
|
2298
2366
|
`;
|
|
2299
|
-
export const
|
|
2367
|
+
export const LANG_GO = `# Go
|
|
2368
|
+
|
|
2369
|
+
## Structure
|
|
2370
|
+
|
|
2371
|
+
The file package must be \`inner\` and export a function called \`main\`:
|
|
2372
|
+
|
|
2373
|
+
\`\`\`go
|
|
2374
|
+
package inner
|
|
2375
|
+
|
|
2376
|
+
func main(param1 string, param2 int) (map[string]interface{}, error) {
|
|
2377
|
+
return map[string]interface{}{
|
|
2378
|
+
"result": param1,
|
|
2379
|
+
"count": param2,
|
|
2380
|
+
}, nil
|
|
2381
|
+
}
|
|
2382
|
+
\`\`\`
|
|
2383
|
+
|
|
2384
|
+
**Important:**
|
|
2385
|
+
- Package must be \`inner\`
|
|
2386
|
+
- Return type must be \`({return_type}, error)\`
|
|
2387
|
+
- Function name is \`main\` (lowercase)
|
|
2388
|
+
|
|
2389
|
+
## Return Types
|
|
2390
|
+
|
|
2391
|
+
The return type can be any Go type that can be serialized to JSON:
|
|
2392
|
+
|
|
2393
|
+
\`\`\`go
|
|
2394
|
+
package inner
|
|
2395
|
+
|
|
2396
|
+
type Result struct {
|
|
2397
|
+
Name string \`json:"name"\`
|
|
2398
|
+
Count int \`json:"count"\`
|
|
2399
|
+
}
|
|
2400
|
+
|
|
2401
|
+
func main(name string, count int) (Result, error) {
|
|
2402
|
+
return Result{
|
|
2403
|
+
Name: name,
|
|
2404
|
+
Count: count,
|
|
2405
|
+
}, nil
|
|
2406
|
+
}
|
|
2407
|
+
\`\`\`
|
|
2408
|
+
|
|
2409
|
+
## Error Handling
|
|
2410
|
+
|
|
2411
|
+
Return errors as the second return value:
|
|
2412
|
+
|
|
2413
|
+
\`\`\`go
|
|
2414
|
+
package inner
|
|
2415
|
+
|
|
2416
|
+
import "errors"
|
|
2417
|
+
|
|
2418
|
+
func main(value int) (string, error) {
|
|
2419
|
+
if value < 0 {
|
|
2420
|
+
return "", errors.New("value must be positive")
|
|
2421
|
+
}
|
|
2422
|
+
return "success", nil
|
|
2423
|
+
}
|
|
2424
|
+
\`\`\`
|
|
2425
|
+
`;
|
|
2426
|
+
export const LANG_GRAPHQL = `# GraphQL
|
|
2427
|
+
|
|
2428
|
+
## Structure
|
|
2429
|
+
|
|
2430
|
+
Write GraphQL queries or mutations. Arguments can be added as query parameters:
|
|
2431
|
+
|
|
2432
|
+
\`\`\`graphql
|
|
2433
|
+
query GetUser($id: ID!) {
|
|
2434
|
+
user(id: $id) {
|
|
2435
|
+
id
|
|
2436
|
+
name
|
|
2437
|
+
email
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2440
|
+
\`\`\`
|
|
2441
|
+
|
|
2442
|
+
## Variables
|
|
2443
|
+
|
|
2444
|
+
Variables are passed as script arguments and automatically bound to the query:
|
|
2445
|
+
|
|
2446
|
+
\`\`\`graphql
|
|
2447
|
+
query SearchProducts($query: String!, $limit: Int = 10) {
|
|
2448
|
+
products(search: $query, first: $limit) {
|
|
2449
|
+
edges {
|
|
2450
|
+
node {
|
|
2451
|
+
id
|
|
2452
|
+
name
|
|
2453
|
+
price
|
|
2454
|
+
}
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
}
|
|
2458
|
+
\`\`\`
|
|
2459
|
+
|
|
2460
|
+
## Mutations
|
|
2461
|
+
|
|
2462
|
+
\`\`\`graphql
|
|
2463
|
+
mutation CreateUser($input: CreateUserInput!) {
|
|
2464
|
+
createUser(input: $input) {
|
|
2465
|
+
id
|
|
2466
|
+
name
|
|
2467
|
+
createdAt
|
|
2468
|
+
}
|
|
2469
|
+
}
|
|
2470
|
+
\`\`\`
|
|
2471
|
+
`;
|
|
2472
|
+
export const LANG_JAVA = `# Java
|
|
2473
|
+
|
|
2474
|
+
The script must contain a Main public class with a \`public static main()\` method:
|
|
2475
|
+
|
|
2476
|
+
\`\`\`java
|
|
2477
|
+
public class Main {
|
|
2478
|
+
public static Object main(String name, int count) {
|
|
2479
|
+
java.util.Map<String, Object> result = new java.util.HashMap<>();
|
|
2480
|
+
result.put("name", name);
|
|
2481
|
+
result.put("count", count);
|
|
2482
|
+
return result;
|
|
2483
|
+
}
|
|
2484
|
+
}
|
|
2485
|
+
\`\`\`
|
|
2486
|
+
|
|
2487
|
+
**Important:**
|
|
2488
|
+
- Class must be named \`Main\`
|
|
2489
|
+
- Method must be \`public static Object main(...)\`
|
|
2490
|
+
- Return type is \`Object\` or \`void\`
|
|
2491
|
+
|
|
2492
|
+
## Maven Dependencies
|
|
2493
|
+
|
|
2494
|
+
Add dependencies using comments at the top:
|
|
2495
|
+
|
|
2496
|
+
\`\`\`java
|
|
2497
|
+
//requirements:
|
|
2498
|
+
//com.google.code.gson:gson:2.10.1
|
|
2499
|
+
//org.apache.httpcomponents:httpclient:4.5.14
|
|
2500
|
+
|
|
2501
|
+
import com.google.gson.Gson;
|
|
2502
|
+
|
|
2503
|
+
public class Main {
|
|
2504
|
+
public static Object main(String input) {
|
|
2505
|
+
Gson gson = new Gson();
|
|
2506
|
+
return gson.fromJson(input, Object.class);
|
|
2507
|
+
}
|
|
2508
|
+
}
|
|
2509
|
+
\`\`\`
|
|
2510
|
+
`;
|
|
2511
|
+
export const LANG_MSSQL = `# Microsoft SQL Server (MSSQL)
|
|
2512
|
+
|
|
2513
|
+
Arguments use \`@P1\`, \`@P2\`, etc.
|
|
2514
|
+
|
|
2515
|
+
Name the parameters by adding comments before the statement:
|
|
2516
|
+
|
|
2517
|
+
\`\`\`sql
|
|
2518
|
+
-- @P1 name1 (varchar)
|
|
2519
|
+
-- @P2 name2 (int) = 0
|
|
2520
|
+
SELECT * FROM users WHERE name = @P1 AND age > @P2;
|
|
2521
|
+
\`\`\`
|
|
2522
|
+
`;
|
|
2523
|
+
export const LANG_MYSQL = `# MySQL
|
|
2524
|
+
|
|
2525
|
+
Arguments use \`?\` placeholders.
|
|
2526
|
+
|
|
2527
|
+
Name the parameters by adding comments before the statement:
|
|
2528
|
+
|
|
2529
|
+
\`\`\`sql
|
|
2530
|
+
-- ? name1 (text)
|
|
2531
|
+
-- ? name2 (int) = 0
|
|
2532
|
+
SELECT * FROM users WHERE name = ? AND age > ?;
|
|
2533
|
+
\`\`\`
|
|
2534
|
+
`;
|
|
2535
|
+
export const LANG_NATIVETS = `# TypeScript (Native)
|
|
2300
2536
|
|
|
2301
2537
|
Native TypeScript execution with fetch only - no external imports allowed.
|
|
2302
2538
|
|
|
@@ -2327,6 +2563,8 @@ export async function main(stripe: RT.Stripe) {
|
|
|
2327
2563
|
|
|
2328
2564
|
Only use resource types if you need them to satisfy the instructions. Always use the RT namespace.
|
|
2329
2565
|
|
|
2566
|
+
Before using a resource type, check the \`rt.d.ts\` file in the project root to see all available resource types and their fields. This file is generated by \`wmill resource-type generate-namespace\`.
|
|
2567
|
+
|
|
2330
2568
|
## Imports
|
|
2331
2569
|
|
|
2332
2570
|
**No imports allowed.** Use the globally available \`fetch\` function:
|
|
@@ -2372,300 +2610,336 @@ export async function preprocessor(event: Event) {
|
|
|
2372
2610
|
}
|
|
2373
2611
|
\`\`\`
|
|
2374
2612
|
`;
|
|
2375
|
-
export const
|
|
2613
|
+
export const LANG_PHP = `# PHP
|
|
2376
2614
|
|
|
2377
|
-
|
|
2615
|
+
## Structure
|
|
2378
2616
|
|
|
2379
|
-
|
|
2617
|
+
The script must start with \`<?php\` and contain at least one function called \`main\`:
|
|
2380
2618
|
|
|
2381
|
-
\`\`\`
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2619
|
+
\`\`\`php
|
|
2620
|
+
<?php
|
|
2621
|
+
|
|
2622
|
+
function main(string $param1, int $param2) {
|
|
2623
|
+
return ["result" => $param1, "count" => $param2];
|
|
2624
|
+
}
|
|
2385
2625
|
\`\`\`
|
|
2386
|
-
`;
|
|
2387
|
-
export const LANG_RUST = `# Rust
|
|
2388
2626
|
|
|
2389
|
-
##
|
|
2627
|
+
## Resource Types
|
|
2390
2628
|
|
|
2391
|
-
|
|
2629
|
+
On Windmill, credentials and configuration are stored in resources and passed as parameters to main.
|
|
2392
2630
|
|
|
2393
|
-
|
|
2394
|
-
use anyhow::anyhow;
|
|
2395
|
-
use serde::Serialize;
|
|
2631
|
+
You need to **redefine** the type of the resources that are needed before the main function. Always check if the class already exists using \`class_exists\`:
|
|
2396
2632
|
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2633
|
+
\`\`\`php
|
|
2634
|
+
<?php
|
|
2635
|
+
|
|
2636
|
+
if (!class_exists('Postgresql')) {
|
|
2637
|
+
class Postgresql {
|
|
2638
|
+
public string $host;
|
|
2639
|
+
public int $port;
|
|
2640
|
+
public string $user;
|
|
2641
|
+
public string $password;
|
|
2642
|
+
public string $dbname;
|
|
2643
|
+
}
|
|
2401
2644
|
}
|
|
2402
2645
|
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
result: param1,
|
|
2406
|
-
count: param2,
|
|
2407
|
-
})
|
|
2646
|
+
function main(Postgresql $db) {
|
|
2647
|
+
// $db contains the database connection details
|
|
2408
2648
|
}
|
|
2409
2649
|
\`\`\`
|
|
2410
2650
|
|
|
2411
|
-
|
|
2412
|
-
- Arguments should be owned types
|
|
2413
|
-
- Return type must be serializable (\`#[derive(Serialize)]\`)
|
|
2414
|
-
- Return type is \`anyhow::Result<T>\`
|
|
2651
|
+
The resource type name has to be exactly as specified.
|
|
2415
2652
|
|
|
2416
|
-
## Dependencies
|
|
2653
|
+
## Library Dependencies
|
|
2417
2654
|
|
|
2418
|
-
|
|
2655
|
+
Specify library dependencies as comments before the main function:
|
|
2419
2656
|
|
|
2420
|
-
\`\`\`
|
|
2421
|
-
|
|
2422
|
-
//! [dependencies]
|
|
2423
|
-
//! anyhow = "1.0.86"
|
|
2424
|
-
//! reqwest = { version = "0.11", features = ["json"] }
|
|
2425
|
-
//! tokio = { version = "1", features = ["full"] }
|
|
2426
|
-
//! \`\`\`
|
|
2657
|
+
\`\`\`php
|
|
2658
|
+
<?php
|
|
2427
2659
|
|
|
2428
|
-
|
|
2429
|
-
//
|
|
2660
|
+
// require:
|
|
2661
|
+
// guzzlehttp/guzzle
|
|
2662
|
+
// stripe/stripe-php@^10.0
|
|
2663
|
+
|
|
2664
|
+
function main() {
|
|
2665
|
+
// Libraries are available
|
|
2666
|
+
}
|
|
2430
2667
|
\`\`\`
|
|
2431
2668
|
|
|
2432
|
-
|
|
2669
|
+
One dependency per line. No need to require autoload, it is already done.
|
|
2670
|
+
`;
|
|
2671
|
+
export const LANG_POSTGRESQL = `# PostgreSQL
|
|
2433
2672
|
|
|
2434
|
-
|
|
2673
|
+
Arguments are obtained directly in the statement with \`$1::{type}\`, \`$2::{type}\`, etc.
|
|
2435
2674
|
|
|
2436
|
-
|
|
2675
|
+
Name the parameters by adding comments at the beginning of the script (without specifying the type):
|
|
2437
2676
|
|
|
2438
|
-
\`\`\`
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2677
|
+
\`\`\`sql
|
|
2678
|
+
-- $1 name1
|
|
2679
|
+
-- $2 name2 = default_value
|
|
2680
|
+
SELECT * FROM users WHERE name = $1::TEXT AND age > $2::INT;
|
|
2681
|
+
\`\`\`
|
|
2682
|
+
`;
|
|
2683
|
+
export const LANG_POWERSHELL = `# PowerShell
|
|
2445
2684
|
|
|
2446
|
-
|
|
2447
|
-
use serde::Serialize;
|
|
2685
|
+
## Structure
|
|
2448
2686
|
|
|
2449
|
-
|
|
2450
|
-
struct Response {
|
|
2451
|
-
data: String,
|
|
2452
|
-
}
|
|
2687
|
+
Arguments are obtained by calling the \`param\` function on the first line:
|
|
2453
2688
|
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2689
|
+
\`\`\`powershell
|
|
2690
|
+
param($Name, $Count = 0, [int]$Age)
|
|
2691
|
+
|
|
2692
|
+
# Your code here
|
|
2693
|
+
Write-Output "Processing $Name, count: $Count, age: $Age"
|
|
2694
|
+
|
|
2695
|
+
# Return object
|
|
2696
|
+
@{
|
|
2697
|
+
name = $Name
|
|
2698
|
+
count = $Count
|
|
2699
|
+
age = $Age
|
|
2460
2700
|
}
|
|
2461
2701
|
\`\`\`
|
|
2462
|
-
`;
|
|
2463
|
-
export const LANG_PHP = `# PHP
|
|
2464
2702
|
|
|
2465
|
-
##
|
|
2703
|
+
## Parameter Types
|
|
2466
2704
|
|
|
2467
|
-
|
|
2705
|
+
You can specify types for parameters:
|
|
2468
2706
|
|
|
2469
|
-
\`\`\`
|
|
2470
|
-
|
|
2707
|
+
\`\`\`powershell
|
|
2708
|
+
param(
|
|
2709
|
+
[string]$Name,
|
|
2710
|
+
[int]$Count = 0,
|
|
2711
|
+
[bool]$Enabled = $true,
|
|
2712
|
+
[array]$Items
|
|
2713
|
+
)
|
|
2471
2714
|
|
|
2472
|
-
|
|
2473
|
-
|
|
2715
|
+
@{
|
|
2716
|
+
name = $Name
|
|
2717
|
+
count = $Count
|
|
2718
|
+
enabled = $Enabled
|
|
2719
|
+
items = $Items
|
|
2474
2720
|
}
|
|
2475
2721
|
\`\`\`
|
|
2476
2722
|
|
|
2477
|
-
##
|
|
2478
|
-
|
|
2479
|
-
On Windmill, credentials and configuration are stored in resources and passed as parameters to main.
|
|
2723
|
+
## Return Values
|
|
2480
2724
|
|
|
2481
|
-
|
|
2725
|
+
Return values by outputting them at the end of the script:
|
|
2482
2726
|
|
|
2483
|
-
\`\`\`
|
|
2484
|
-
|
|
2727
|
+
\`\`\`powershell
|
|
2728
|
+
param($Input)
|
|
2485
2729
|
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
public string $user;
|
|
2491
|
-
public string $password;
|
|
2492
|
-
public string $dbname;
|
|
2493
|
-
}
|
|
2730
|
+
$result = @{
|
|
2731
|
+
processed = $true
|
|
2732
|
+
data = $Input
|
|
2733
|
+
timestamp = Get-Date -Format "o"
|
|
2494
2734
|
}
|
|
2495
2735
|
|
|
2496
|
-
|
|
2497
|
-
// $db contains the database connection details
|
|
2498
|
-
}
|
|
2736
|
+
$result
|
|
2499
2737
|
\`\`\`
|
|
2738
|
+
`;
|
|
2739
|
+
export const LANG_PYTHON3 = `# Python
|
|
2500
2740
|
|
|
2501
|
-
|
|
2741
|
+
## Structure
|
|
2502
2742
|
|
|
2503
|
-
|
|
2743
|
+
The script must contain at least one function called \`main\`:
|
|
2504
2744
|
|
|
2505
|
-
|
|
2745
|
+
\`\`\`python
|
|
2746
|
+
def main(param1: str, param2: int):
|
|
2747
|
+
# Your code here
|
|
2748
|
+
return {"result": param1, "count": param2}
|
|
2749
|
+
\`\`\`
|
|
2506
2750
|
|
|
2507
|
-
|
|
2508
|
-
<?php
|
|
2751
|
+
Do not call the main function. Libraries are installed automatically.
|
|
2509
2752
|
|
|
2510
|
-
|
|
2511
|
-
// guzzlehttp/guzzle
|
|
2512
|
-
// stripe/stripe-php@^10.0
|
|
2753
|
+
## Resource Types
|
|
2513
2754
|
|
|
2514
|
-
|
|
2515
|
-
// Libraries are available
|
|
2516
|
-
}
|
|
2517
|
-
\`\`\`
|
|
2755
|
+
On Windmill, credentials and configuration are stored in resources and passed as parameters to main.
|
|
2518
2756
|
|
|
2519
|
-
|
|
2520
|
-
`;
|
|
2521
|
-
export const LANG_MSSQL = `# Microsoft SQL Server (MSSQL)
|
|
2757
|
+
You need to **redefine** the type of the resources that are needed before the main function as TypedDict:
|
|
2522
2758
|
|
|
2523
|
-
|
|
2759
|
+
\`\`\`python
|
|
2760
|
+
from typing import TypedDict
|
|
2524
2761
|
|
|
2525
|
-
|
|
2762
|
+
class postgresql(TypedDict):
|
|
2763
|
+
host: str
|
|
2764
|
+
port: int
|
|
2765
|
+
user: str
|
|
2766
|
+
password: str
|
|
2767
|
+
dbname: str
|
|
2526
2768
|
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
SELECT * FROM users WHERE name = @P1 AND age > @P2;
|
|
2769
|
+
def main(db: postgresql):
|
|
2770
|
+
# db contains the database connection details
|
|
2771
|
+
pass
|
|
2531
2772
|
\`\`\`
|
|
2532
|
-
`;
|
|
2533
|
-
export const LANG_POSTGRESQL = `# PostgreSQL
|
|
2534
2773
|
|
|
2535
|
-
|
|
2774
|
+
**Important rules:**
|
|
2536
2775
|
|
|
2537
|
-
|
|
2776
|
+
- The resource type name must be **IN LOWERCASE**
|
|
2777
|
+
- Only include resource types if they are actually needed
|
|
2778
|
+
- If an import conflicts with a resource type name, **rename the imported object, not the type name**
|
|
2779
|
+
- Make sure to import TypedDict from typing **if you're using it**
|
|
2538
2780
|
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2781
|
+
## Imports
|
|
2782
|
+
|
|
2783
|
+
Libraries are installed automatically. Do not show installation instructions.
|
|
2784
|
+
|
|
2785
|
+
\`\`\`python
|
|
2786
|
+
import requests
|
|
2787
|
+
import pandas as pd
|
|
2788
|
+
from datetime import datetime
|
|
2543
2789
|
\`\`\`
|
|
2544
|
-
`;
|
|
2545
|
-
export const LANG_GRAPHQL = `# GraphQL
|
|
2546
2790
|
|
|
2547
|
-
|
|
2791
|
+
If an import name conflicts with a resource type:
|
|
2548
2792
|
|
|
2549
|
-
|
|
2793
|
+
\`\`\`python
|
|
2794
|
+
# Wrong - don't rename the type
|
|
2795
|
+
import stripe as stripe_lib
|
|
2796
|
+
class stripe_type(TypedDict): ...
|
|
2550
2797
|
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
name
|
|
2556
|
-
email
|
|
2557
|
-
}
|
|
2558
|
-
}
|
|
2798
|
+
# Correct - rename the import
|
|
2799
|
+
import stripe as stripe_sdk
|
|
2800
|
+
class stripe(TypedDict):
|
|
2801
|
+
api_key: str
|
|
2559
2802
|
\`\`\`
|
|
2560
2803
|
|
|
2561
|
-
##
|
|
2804
|
+
## Windmill Client
|
|
2562
2805
|
|
|
2563
|
-
|
|
2806
|
+
Import the windmill client for platform interactions:
|
|
2564
2807
|
|
|
2565
|
-
\`\`\`
|
|
2566
|
-
|
|
2567
|
-
products(search: $query, first: $limit) {
|
|
2568
|
-
edges {
|
|
2569
|
-
node {
|
|
2570
|
-
id
|
|
2571
|
-
name
|
|
2572
|
-
price
|
|
2573
|
-
}
|
|
2574
|
-
}
|
|
2575
|
-
}
|
|
2576
|
-
}
|
|
2808
|
+
\`\`\`python
|
|
2809
|
+
import wmill
|
|
2577
2810
|
\`\`\`
|
|
2578
2811
|
|
|
2579
|
-
|
|
2812
|
+
See the SDK documentation for available methods.
|
|
2580
2813
|
|
|
2581
|
-
|
|
2582
|
-
mutation CreateUser($input: CreateUserInput!) {
|
|
2583
|
-
createUser(input: $input) {
|
|
2584
|
-
id
|
|
2585
|
-
name
|
|
2586
|
-
createdAt
|
|
2587
|
-
}
|
|
2588
|
-
}
|
|
2589
|
-
\`\`\`
|
|
2590
|
-
`;
|
|
2591
|
-
export const LANG_CSHARP = `# C#
|
|
2814
|
+
## Preprocessor Scripts
|
|
2592
2815
|
|
|
2593
|
-
|
|
2816
|
+
For preprocessor scripts, the function should be named \`preprocessor\` and receives an \`event\` parameter:
|
|
2594
2817
|
|
|
2595
|
-
\`\`\`
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2818
|
+
\`\`\`python
|
|
2819
|
+
from typing import TypedDict, Literal, Any
|
|
2820
|
+
|
|
2821
|
+
class Event(TypedDict):
|
|
2822
|
+
kind: Literal["webhook", "http", "websocket", "kafka", "email", "nats", "postgres", "sqs", "mqtt", "gcp"]
|
|
2823
|
+
body: Any
|
|
2824
|
+
headers: dict[str, str]
|
|
2825
|
+
query: dict[str, str]
|
|
2826
|
+
|
|
2827
|
+
def preprocessor(event: Event):
|
|
2828
|
+
# Transform the event into flow input parameters
|
|
2829
|
+
return {
|
|
2830
|
+
"param1": event["body"]["field1"],
|
|
2831
|
+
"param2": event["query"]["id"]
|
|
2601
2832
|
}
|
|
2602
|
-
}
|
|
2603
2833
|
\`\`\`
|
|
2604
2834
|
|
|
2605
|
-
|
|
2606
|
-
- Class name is irrelevant
|
|
2607
|
-
- Method must be \`public static\`
|
|
2608
|
-
- Return type can be \`object\` or specific type
|
|
2835
|
+
## S3 Object Operations
|
|
2609
2836
|
|
|
2610
|
-
|
|
2837
|
+
Windmill provides built-in support for S3-compatible storage operations.
|
|
2611
2838
|
|
|
2612
|
-
|
|
2839
|
+
\`\`\`python
|
|
2840
|
+
import wmill
|
|
2613
2841
|
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
#r "nuget: RestSharp, 110.2.0"
|
|
2842
|
+
# Load file content from S3
|
|
2843
|
+
content: bytes = wmill.load_s3_file(s3object)
|
|
2617
2844
|
|
|
2618
|
-
|
|
2619
|
-
|
|
2845
|
+
# Load file as stream reader
|
|
2846
|
+
reader: BufferedReader = wmill.load_s3_file_reader(s3object)
|
|
2620
2847
|
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
}
|
|
2630
|
-
}
|
|
2848
|
+
# Write file to S3
|
|
2849
|
+
result: S3Object = wmill.write_s3_file(
|
|
2850
|
+
s3object, # Target path (or None to auto-generate)
|
|
2851
|
+
file_content, # bytes or BufferedReader
|
|
2852
|
+
s3_resource_path, # Optional: specific S3 resource
|
|
2853
|
+
content_type, # Optional: MIME type
|
|
2854
|
+
content_disposition # Optional: Content-Disposition header
|
|
2855
|
+
)
|
|
2631
2856
|
\`\`\`
|
|
2632
2857
|
`;
|
|
2633
|
-
export const
|
|
2858
|
+
export const LANG_RUST = `# Rust
|
|
2634
2859
|
|
|
2635
|
-
|
|
2860
|
+
## Structure
|
|
2636
2861
|
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2862
|
+
The script must contain a function called \`main\` with proper return type:
|
|
2863
|
+
|
|
2864
|
+
\`\`\`rust
|
|
2865
|
+
use anyhow::anyhow;
|
|
2866
|
+
use serde::Serialize;
|
|
2867
|
+
|
|
2868
|
+
#[derive(Serialize, Debug)]
|
|
2869
|
+
struct ReturnType {
|
|
2870
|
+
result: String,
|
|
2871
|
+
count: i32,
|
|
2872
|
+
}
|
|
2873
|
+
|
|
2874
|
+
fn main(param1: String, param2: i32) -> anyhow::Result<ReturnType> {
|
|
2875
|
+
Ok(ReturnType {
|
|
2876
|
+
result: param1,
|
|
2877
|
+
count: param2,
|
|
2878
|
+
})
|
|
2645
2879
|
}
|
|
2646
2880
|
\`\`\`
|
|
2647
2881
|
|
|
2648
2882
|
**Important:**
|
|
2649
|
-
-
|
|
2650
|
-
-
|
|
2651
|
-
- Return type is \`
|
|
2883
|
+
- Arguments should be owned types
|
|
2884
|
+
- Return type must be serializable (\`#[derive(Serialize)]\`)
|
|
2885
|
+
- Return type is \`anyhow::Result<T>\`
|
|
2652
2886
|
|
|
2653
|
-
##
|
|
2887
|
+
## Dependencies
|
|
2654
2888
|
|
|
2655
|
-
|
|
2889
|
+
Packages must be specified with a partial cargo.toml at the beginning of the script:
|
|
2656
2890
|
|
|
2657
|
-
\`\`\`
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2891
|
+
\`\`\`rust
|
|
2892
|
+
//! \`\`\`cargo
|
|
2893
|
+
//! [dependencies]
|
|
2894
|
+
//! anyhow = "1.0.86"
|
|
2895
|
+
//! reqwest = { version = "0.11", features = ["json"] }
|
|
2896
|
+
//! tokio = { version = "1", features = ["full"] }
|
|
2897
|
+
//! \`\`\`
|
|
2661
2898
|
|
|
2662
|
-
|
|
2899
|
+
use anyhow::anyhow;
|
|
2900
|
+
// ... rest of the code
|
|
2901
|
+
\`\`\`
|
|
2663
2902
|
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2903
|
+
**Note:** Serde is already included, no need to add it again.
|
|
2904
|
+
|
|
2905
|
+
## Async Functions
|
|
2906
|
+
|
|
2907
|
+
If you need to handle async functions (e.g., using tokio), keep the main function sync and create the runtime inside:
|
|
2908
|
+
|
|
2909
|
+
\`\`\`rust
|
|
2910
|
+
//! \`\`\`cargo
|
|
2911
|
+
//! [dependencies]
|
|
2912
|
+
//! anyhow = "1.0.86"
|
|
2913
|
+
//! tokio = { version = "1", features = ["full"] }
|
|
2914
|
+
//! reqwest = { version = "0.11", features = ["json"] }
|
|
2915
|
+
//! \`\`\`
|
|
2916
|
+
|
|
2917
|
+
use anyhow::anyhow;
|
|
2918
|
+
use serde::Serialize;
|
|
2919
|
+
|
|
2920
|
+
#[derive(Serialize, Debug)]
|
|
2921
|
+
struct Response {
|
|
2922
|
+
data: String,
|
|
2669
2923
|
}
|
|
2924
|
+
|
|
2925
|
+
fn main(url: String) -> anyhow::Result<Response> {
|
|
2926
|
+
let rt = tokio::runtime::Runtime::new()?;
|
|
2927
|
+
rt.block_on(async {
|
|
2928
|
+
let resp = reqwest::get(&url).await?.text().await?;
|
|
2929
|
+
Ok(Response { data: resp })
|
|
2930
|
+
})
|
|
2931
|
+
}
|
|
2932
|
+
\`\`\`
|
|
2933
|
+
`;
|
|
2934
|
+
export const LANG_SNOWFLAKE = `# Snowflake
|
|
2935
|
+
|
|
2936
|
+
Arguments use \`?\` placeholders.
|
|
2937
|
+
|
|
2938
|
+
Name the parameters by adding comments before the statement:
|
|
2939
|
+
|
|
2940
|
+
\`\`\`sql
|
|
2941
|
+
-- ? name1 (text)
|
|
2942
|
+
-- ? name2 (number) = 0
|
|
2943
|
+
SELECT * FROM users WHERE name = ? AND age > ?;
|
|
2670
2944
|
\`\`\`
|
|
2671
2945
|
`;
|