Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "writer"
version = "0.8.3rc8"
version = "0.8.3rc9"
description = "An open-source, Python framework for building feature-rich apps that are fully integrated with the Writer platform."
authors = ["Writer, Inc."]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/BuilderSwitcher.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@click="selectOption('workflows')"
>
<i class="icon material-symbols-outlined"> linked_services </i>
Workflows
Blueprints
</div>
<div
:class="{ active: activeId == 'preview' }"
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/sidebar/BuilderSidebarComponentTree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
@click="addWorkflow"
>
<i class="material-symbols-outlined"> add </i> Add
workflow</WdsButton
blueprint</WdsButton
>
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const name = computed(() => {
return component.value.content?.["element"];
}
if (type == "workflows_workflow") {
return component.value.content?.["key"] || "Workflow";
return component.value.content?.["key"] || "Blueprint";
}
return def.value?.name ?? `Unknown (${component.value.type})`;
});
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/builder/sidebar/BuilderSidebarToolkit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const searchCount = computed(() => {

const placeholder = computed(() => {
if (activeToolkit.value == "core") return "Core toolkit";
if (activeToolkit.value == "workflows") return "Workflows toolkit";
if (activeToolkit.value == "workflows") return "Blueprints toolkit";
return "Toolkit";
});

Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/components/workflows/WorkflowsRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const description =

export default {
writer: {
name: "Workflows Root",
name: "Blueprints Root",
toolkit: "workflows",
category: "Root",
description,
Expand Down
4 changes: 2 additions & 2 deletions src/ui/src/components/workflows/WorkflowsWorkflow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
@click="handleRun"
>
<i class="material-symbols-outlined">play_arrow</i>
{{ isRunning ? "Running..." : "Run workflow" }}
{{ isRunning ? "Running..." : "Run blueprint" }}
</WdsButton>
</div>
<WorkflowNavigator
Expand Down Expand Up @@ -93,7 +93,7 @@ const description =

export default {
writer: {
name: "Workflow",
name: "Blueprint",
toolkit: "workflows",
category: "Root",
description,
Expand Down
78 changes: 41 additions & 37 deletions src/writer/blocks/runworkflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,58 @@


class RunWorkflow(WorkflowBlock):

@classmethod
def register(cls, type: str):
super(RunWorkflow, cls).register(type)
register_abstract_template(type, AbstractTemplate(
baseType="workflows_node",
writer={
"name": "Run workflow",
"description": "Executes a workflow with a given key.",
"category": "Logic",
"fields": {
"workflowKey": {
"name": "Workflow Key",
"type": "Workflow Key",
"validator": {
"type": "string",
"format": "writer#workflowKey",
}
},
"payload": {
"name": "Payload",
"desc": "The value specified will be available using the template syntax i.e. @{payload}",
"default": "{}",
"type": "Text",
"control": "Textarea"
},
},
"outs": {
"success": {
"name": "Success",
"description": "The request was successful.",
"style": "success",
register_abstract_template(
type,
AbstractTemplate(
baseType="workflows_node",
writer={
"name": "Run blueprint",
"description": "Executes a workflow with a given key.",
"category": "Logic",
"fields": {
"workflowKey": {
"name": "Workflow Key",
"type": "Workflow Key",
"validator": {
"type": "string",
"format": "writer#workflowKey",
},
},
"payload": {
"name": "Payload",
"desc": "The value specified will be available using the template syntax i.e. @{payload}",
"default": "{}",
"type": "Text",
"control": "Textarea",
},
},
"error": {
"name": "Error",
"description": "The workflow was executed successfully.",
"style": "error",
"outs": {
"success": {
"name": "Success",
"description": "The request was successful.",
"style": "success",
},
"error": {
"name": "Error",
"description": "The workflow was executed successfully.",
"style": "error",
},
},
},
}
))
),
)

def run(self):
try:
workflow_key = self._get_field("workflowKey")
payload = self._get_field("payload")
expanded_execution_environment = self.execution_environment | { "payload": payload }
return_value = self.runner.run_workflow_by_key(workflow_key, expanded_execution_environment)
expanded_execution_environment = self.execution_environment | {"payload": payload}
return_value = self.runner.run_workflow_by_key(
workflow_key, expanded_execution_environment
)
self.result = return_value
self.outcome = "success"
except BaseException as e:
Expand Down
66 changes: 32 additions & 34 deletions src/writer/blocks/writernocodeapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,44 @@


class WriterNoCodeApp(WorkflowBlock):

@classmethod
def register(cls, type: str):
super(WriterNoCodeApp, cls).register(type)
register_abstract_template(type, AbstractTemplate(
baseType="workflows_node",
writer={
"name": "No-code app",
"description": "Run a no-code app.",
"category": "Writer",
"fields": {
"appId": {
"name": "App Id",
"type": "App Id",
"desc": "The app id can be found in the app's URL. It has a UUID format.",
"validator": {
"type": "string",
"format": "uuid",
}
},
"appInputs": {
"name": "App inputs",
"type": "Key-Value",
"default": "{}"
},
},
"outs": {
"success": {
"name": "Success",
"description": "If the execution was successful.",
"style": "success",
register_abstract_template(
type,
AbstractTemplate(
baseType="workflows_node",
writer={
"name": "No-code agent",
"description": "Run a no-code agent.",
"category": "Writer",
"fields": {
"appId": {
"name": "App Id",
"type": "App Id",
"desc": "The agent id can be found in the agent's URL. It has a UUID format.",
"validator": {
"type": "string",
"format": "uuid",
},
},
"appInputs": {"name": "App inputs", "type": "Key-Value", "default": "{}"},
},
"error": {
"name": "Error",
"description": "If the function raises an Exception.",
"style": "error",
"outs": {
"success": {
"name": "Success",
"description": "If the execution was successful.",
"style": "success",
},
"error": {
"name": "Error",
"description": "If the function raises an Exception.",
"style": "error",
},
},
},
}
))
),
)

def run(self):
try:
Expand Down