Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore: Editable fields for workflow step details (#65853)

Luke Belton816e790d1d4c
diff --git a/products/workflows/frontend/Workflows/hogflows/panel/HogFlowEditorPanelBuildDetail.tsx b/products/workflows/frontend/Workflows/hogflows/panel/HogFlowEditorPanelBuildDetail.tsx
index 3dea7bc9a8dc..0f31ec7f8861 100644
--- a/products/workflows/frontend/Workflows/hogflows/panel/HogFlowEditorPanelBuildDetail.tsx
+++ b/products/workflows/frontend/Workflows/hogflows/panel/HogFlowEditorPanelBuildDetail.tsx
@@ -13,6 +13,7 @@ import {
LemonSelect,
} from '@posthog/lemon-ui'
+import { EditableField } from 'lib/components/EditableField/EditableField'
import { ScrollableShadows } from 'lib/components/ScrollableShadows/ScrollableShadows'
import { LemonField } from 'lib/lemon-ui/LemonField/LemonField'
import { urls } from 'scenes/urls'
@@ -23,7 +24,7 @@ import { workflowLogic } from '../../workflowLogic'
import { HogFlowPropertyFilters } from '../filters/HogFlowFilters'
import { hogFlowEditorLogic } from '../hogFlowEditorLogic'
import { useHogFlowStep } from '../steps/HogFlowSteps'
-import { isOptOutEligibleAction } from '../steps/types'
+import { isOptOutEligibleAction, isScheduleTrigger } from '../steps/types'
import type { HogFlowAction } from '../types'
import { hogFlowOutputMappingLogic } from './hogFlowOutputMappingLogic'
import { OutputTestResultTree } from './OutputTestResultTree'
@@ -79,6 +80,42 @@ export function HogFlowEditorPanelBuildDetail(): JSX.Element | null {
innerClassName="flex flex-col gap-2 p-3"
styledScrollbars
>
+ <div className="flex flex-col gap-1">
+ <EditableField
+ name="step-name"
+ value={action.name}
+ onSave={(value) => {
+ const trimmed = value.trim()
+ if (trimmed) {
+ setWorkflowAction(action.id, { ...action, name: trimmed })
+ }
+ }}
+ placeholder="Step name"
+ minLength={1}
+ saveOnBlur
+ clickToEdit
+ compactButtons
+ compactIcon
+ className="font-semibold text-base"
+ data-attr="workflow-step-name"
+ />
+ {!isScheduleTrigger(action) && (
+ <EditableField
+ name="step-description"
+ value={action.description || ''}
+ onSave={(value) => setWorkflowAction(action.id, { ...action, description: value.trim() })}
+ placeholder="Add a description (optional)"
+ multiline
+ saveOnBlur
+ clickToEdit
+ compactButtons
+ compactIcon
+ className="text-sm text-secondary"
+ data-attr="workflow-step-description"
+ />
+ )}
+ </div>
+ <LemonDivider className="my-2" />
{Step?.renderConfiguration(selectedNode)}
</ScrollableShadows>
diff --git a/products/workflows/frontend/Workflows/hogflows/steps/components/StepView.tsx b/products/workflows/frontend/Workflows/hogflows/steps/components/StepView.tsx
index a4bfae638375..e6d9e0dee06f 100644
--- a/products/workflows/frontend/Workflows/hogflows/steps/components/StepView.tsx
+++ b/products/workflows/frontend/Workflows/hogflows/steps/components/StepView.tsx
@@ -14,6 +14,7 @@ import { hogFlowEditorLogic } from '../../hogFlowEditorLogic'
import { NODE_HEIGHT, NODE_WIDTH } from '../../react_flow_utils/constants'
import { HogFlowAction } from '../../types'
import { useHogFlowStep } from '../HogFlowSteps'
+import { isScheduleTrigger } from '../types'
import { buildSummary } from './rrule-helpers'
import { StepViewLogicProps, stepViewLogic } from './stepViewLogic'
import { StepViewMetrics } from './StepViewMetrics'
@@ -33,9 +34,8 @@ export function StepView({ action }: { action: HogFlowAction }): JSX.Element {
useValues(workflowLogic)
const { deleteElements } = useReactFlow()
- const isScheduleTrigger = action.type === 'trigger' && (action.config as any)?.type === 'schedule'
const scheduleDescription = useMemo(() => {
- if (!isScheduleTrigger) {
+ if (!isScheduleTrigger(action)) {
return null
}
if (!scheduleStartsAt) {
@@ -45,7 +45,7 @@ export function StepView({ action }: { action: HogFlowAction }): JSX.Element {
return 'One-time run'
}
return buildSummary(scheduleState, scheduleStartsAt)
- }, [isScheduleTrigger, scheduleState, scheduleStartsAt, isScheduleRepeating])
+ }, [action, scheduleState, scheduleStartsAt, isScheduleRepeating])
const isSelected = selectedNode?.id === action.id
const node = nodesById[action.id]
@@ -186,9 +186,9 @@ export function StepView({ action }: { action: HogFlowAction }): JSX.Element {
) : (
<Tooltip title={scheduleDescription ?? action.description ?? ''}>
<div
- className={`text-[0.3rem]/1.5 text-muted line-clamp-2 !rounded-sm px-0.5 -mx-0.5 transition-colors pl-1 min-w-0 min-h-[0.45rem] overflow-hidden ${isSelected && !isScheduleTrigger ? 'cursor-text hover:bg-fill-button-tertiary-hover' : ''}`}
+ className={`text-[0.3rem]/1.5 text-muted line-clamp-2 !rounded-sm px-0.5 -mx-0.5 transition-colors pl-1 min-w-0 min-h-[0.45rem] overflow-hidden ${isSelected && !isScheduleTrigger(action) ? 'cursor-text hover:bg-fill-button-tertiary-hover' : ''}`}
onClick={(e) => {
- if (isSelected && !isScheduleTrigger) {
+ if (isSelected && !isScheduleTrigger(action)) {
e.stopPropagation()
startEditingDescription()
}
diff --git a/products/workflows/frontend/Workflows/hogflows/steps/types.ts b/products/workflows/frontend/Workflows/hogflows/steps/types.ts
index 19c3e5f4031e..443358b77edf 100644
--- a/products/workflows/frontend/Workflows/hogflows/steps/types.ts
+++ b/products/workflows/frontend/Workflows/hogflows/steps/types.ts
@@ -316,6 +316,14 @@ export const isTriggerFunction = (
return ['webhook', 'tracking_pixel', 'manual'].includes(trigger.config.type)
}
+export const isScheduleTrigger = (action: HogFlowAction): boolean => {
+ if (action.type !== 'trigger') {
+ return false
+ }
+ const trigger = action as Extract<HogFlowAction, { type: 'trigger' }>
+ return trigger.config.type === 'schedule'
+}
+
export interface HogflowTestResult {
status: 'success' | 'error' | 'skipped'
logs?: LogEntry[]