Skip to content

Automate browser based workflows with AI

Add TOTP stuff to task node (#793)

Kerem Yilmaz5ab54999c4ab
diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/TaskNode/TaskNode.tsx b/skyvern-frontend/src/routes/workflows/editor/nodes/TaskNode/TaskNode.tsx
index 0cd5e7ce7..784bbd73b 100644
--- a/skyvern-frontend/src/routes/workflows/editor/nodes/TaskNode/TaskNode.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/TaskNode/TaskNode.tsx
@@ -71,7 +71,7 @@ function TaskNode({ id, data }: NodeProps<TaskNode>) {
<>
<Accordion
type="multiple"
- defaultValue={["content", "extraction", "limits"]}
+ defaultValue={["content", "extraction", "limits", "totp"]}
>
<AccordionItem value="content">
<AccordionTrigger>Content</AccordionTrigger>
@@ -261,6 +261,47 @@ function TaskNode({ id, data }: NodeProps<TaskNode>) {
</div>
</AccordionContent>
</AccordionItem>
+ <AccordionItem value="totp">
+ <AccordionTrigger>TOTP</AccordionTrigger>
+ <AccordionContent className="pl-[1.5rem] pr-1">
+ <div className="space-y-4">
+ <div className="space-y-1">
+ <Label className="text-xs text-slate-300">
+ TOTP Verification URL
+ </Label>
+ <AutoResizingTextarea
+ onChange={(event) => {
+ if (!editable) {
+ return;
+ }
+ updateNodeData(id, {
+ totpVerificationUrl: event.target.value,
+ });
+ }}
+ value={data.totpVerificationUrl ?? ""}
+ placeholder="https://"
+ className="nopan"
+ />
+ </div>
+ <div className="space-y-1">
+ <Label className="text-xs text-slate-300">
+ TOTP Identifier
+ </Label>
+ <AutoResizingTextarea
+ onChange={(event) => {
+ if (!editable) {
+ return;
+ }
+ updateNodeData(id, { totpIdentifier: event.target.value });
+ }}
+ value={data.totpIdentifier ?? ""}
+ placeholder="Identifier"
+ className="nopan"
+ />
+ </div>
+ </div>
+ </AccordionContent>
+ </AccordionItem>
</Accordion>
</>
);
diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/TaskNode/types.ts b/skyvern-frontend/src/routes/workflows/editor/nodes/TaskNode/types.ts
index 2c372e2bc..81a510bc4 100644
--- a/skyvern-frontend/src/routes/workflows/editor/nodes/TaskNode/types.ts
+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/TaskNode/types.ts
@@ -12,6 +12,8 @@ export type TaskNodeData = {
editable: boolean;
label: string;
parameterKeys: Array<string>;
+ totpVerificationUrl: string | null;
+ totpIdentifier: string | null;
};
export type TaskNode = Node<TaskNodeData, "task">;
@@ -30,4 +32,6 @@ export const taskNodeDefaultData: TaskNodeData = {
editable: true,
label: "",
parameterKeys: [],
+ totpVerificationUrl: null,
+ totpIdentifier: null,
} as const;
diff --git a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts
index b81119715..7924db58f 100644
--- a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts
+++ b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts
@@ -112,6 +112,8 @@ function convertToNode(
maxRetries: block.max_retries ?? null,
maxStepsOverride: block.max_steps_per_run ?? null,
parameterKeys: block.parameters.map((p) => p.key),
+ totpIdentifier: block.totp_identifier ?? null,
+ totpVerificationUrl: block.totp_verification_url ?? null,
},
};
}
@@ -402,6 +404,8 @@ function getWorkflowBlock(
max_steps_per_run: node.data.maxStepsOverride,
complete_on_download: node.data.allowDownloads,
parameter_keys: node.data.parameterKeys,
+ totp_identifier: node.data.totpIdentifier,
+ totp_verification_url: node.data.totpVerificationUrl,
};
}
case "sendEmail": {
diff --git a/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts b/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts
index 1afb803f9..001a529bd 100644
--- a/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts
+++ b/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts
@@ -134,6 +134,8 @@ export type TaskBlock = WorkflowBlockBase & {
max_steps_per_run?: number | null;
parameters: Array<WorkflowParameter>;
complete_on_download?: boolean;
+ totp_verification_url?: string | null;
+ totp_identifier?: string | null;
};
export type ForLoopBlock = WorkflowBlockBase & {
diff --git a/skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts b/skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts
index b93c0f5fc..ea6c873ca 100644
--- a/skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts
+++ b/skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts
@@ -79,6 +79,8 @@ export type TaskBlockYAML = BlockYAMLBase & {
max_steps_per_run?: number | null;
parameter_keys?: Array<string> | null;
complete_on_download?: boolean;
+ totp_verification_url?: string | null;
+ totp_identifier?: string | null;
};
export type CodeBlockYAML = BlockYAMLBase & {