: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(cdp): banner to replay destinations that lost their credentials (#86989)
Harley Alexander41360bf996b9
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 05d08d409204..6e0b5c569146 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -6108,6 +6108,10 @@ snapshots:hash: v1.k794b7964.6fa2b66d27a1675f40be299d4063d6530d9b7899854e2a4f90a7ed9261457532.zZxRebzp1LR0fgFq5G61QARku_wdiC8mrBG5BtU4Iloscenes-app-data-management-revenue-analytics-event-configuration-modal--default--light:hash: v1.k794b7964.380602ae2b746844554126dce9f27bca9ec04854e281d8467c8de724f4fd49fc.ySrW_TUWEFnfdhQOLX6USTN5uxF1kODMuE5iXuYWtQU+ scenes-app-data-pipelines-destinations-incident-replay-banner--default--dark:+ hash: v1.k794b7964.1fa2847afd2dfb946f145bd4f7a4393dd95c5fccbea361717dafb545b2974238.BS3GjT1_e9vpLhMf5Qr5LkKrpPeP5hgNnmrxX4v_EWQ+ scenes-app-data-pipelines-destinations-incident-replay-banner--default--light:+ hash: v1.k794b7964.bc32207650f48ba87bd791f524d84462ecd0cbaa07046e630a1cffde3c68e89e.GHu9dguBRJH_zxhQ8XlozqUsTT3JlpkPVCiFIr26_rkscenes-app-data-pipelines-event-filtering--add-condition-and-test-case--dark:hash: v1.k794b7964.054b485fa44909bda3f635ba9d134cea4dfa7e60bbc65206ba752f23b7729c42._2cxQzZ_XmaTvoI9Z7hIKh5kpuDY5rxQG0-1RNRyDgEscenes-app-data-pipelines-event-filtering--add-condition-and-test-case--light:@@ -6333,7 +6337,7 @@ snapshots:scenes-app-experiments--experiment-frequentist-two-variants--light:hash: v1.k794b7964.ec64583fd2debf87822296f1c9fc10e73c1c6b7e31fe55f0ca974d3920f8bd14.Ch64gBgjo0wR0Ypvkhap6047UPjXBaWSQCNoKDOiNHcscenes-app-experiments--experiment-stopped-with-conclusion--dark:- hash: v1.k794b7964.0ed912970ce0a55c45fd54799febd21547cedb04534a56e8e789f7ee787c3b39.L7iFT9xjm0sWN6iCtvk9K_z2PKUSEOYkHI_b1oizB2M+ hash: v1.k794b7964.37e8127d5a33175889cf1da00e80998b1858fd3713fe5c0c1ec42ff0bb1da220.oIA6fAIpYfvfCAh_6TQs-uqDeMEONwTb3luZF1rzBs4scenes-app-experiments--experiment-stopped-with-conclusion--light:hash: v1.k794b7964.793a4b6109b2c0ab65b07d9eaefd1c8862f12bfc7f33b2f452ad20044396b2a7.6B0Meq7yO75vBEoBmuP2dNl2oKTugzzr_IKTcJHhEi0scenes-app-experiments--experiment-with-funnel-metric--dark:diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsxindex 8f477f1a4531..812921c54980 100644--- a/frontend/src/lib/constants.tsx+++ b/frontend/src/lib/constants.tsx@@ -302,6 +302,7 @@ export const FEATURE_FLAGS = {DATA_WAREHOUSE_SCENE: 'data-warehouse-scene', // owner: #team-data-modelingDATA_WAREHOUSE_SEMANTIC_ENRICHMENT: 'data-warehouse-semantic-enrichment', // owner: #team-warehouse-sourcesDEFAULT_EVALUATION_ENVIRONMENTS: 'default-evaluation-environments', // owner: @dmarticus #team-feature-flags+ DESTINATIONS_INCIDENT_REPLAY: 'destinations-incident-replay', // owner: #team-workflowsDISCUSSIONS_SLACK_SYNC: 'discussions-slack-sync', // owner: #team-platform-featuresDROP_PERSON_LIST_ORDER_BY: 'drop-person-list-order-by', // owner: @arthurdedeus #team-customer-analyticsDWH_POSTGRES_CDC: 'dwh-postgres-cdc', // owner: #team-warehouse-sourcesdiff --git a/frontend/src/scenes/data-pipelines/DestinationsScene.tsx b/frontend/src/scenes/data-pipelines/DestinationsScene.tsxindex 74d535a49a69..4c31dc3af042 100644--- a/frontend/src/scenes/data-pipelines/DestinationsScene.tsx+++ b/frontend/src/scenes/data-pipelines/DestinationsScene.tsx@@ -15,6 +15,8 @@ import { SceneTitleSection } from '~/layout/scenes/components/SceneTitleSection'import { ProductKey } from '~/queries/schema/schema-general'import { ActivityScope } from '~/types'+import { DestinationsIncidentReplayBanner } from 'products/cdp/frontend/DestinationsIncidentReplayBanner'+import { DataPipelinesHogFunctions } from './DataPipelinesHogFunctions'import { destinationsSceneLogic } from './destinationsSceneLogic'@@ -78,6 +80,7 @@ export function DestinationsScene(): JSX.Element {}}actions={action}/>+ <DestinationsIncidentReplayBanner /><LemonTabsactiveKey={activeTab}onChange={(key) => setActiveTab(key as 'all' | 'history')}diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 14440e6fb8a9..c62f51a2b4b6 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -2625,10 +2625,16 @@ importers:kea-loaders:specifier: 'catalog:'version: 3.1.1([email protected](patch_hash=139b8d1f1304f9d9da452a9a1244c94ea679dbcb85687d8999563146879fb6f5)([email protected]))+ kea-subscriptions:+ specifier: 'catalog:'+ version: 3.0.1([email protected](patch_hash=139b8d1f1304f9d9da452a9a1244c94ea679dbcb85687d8999563146879fb6f5)([email protected]))react:specifier: 18.3.1version: 18.3.1devDependencies:+ '@storybook/react':+ specifier: 'catalog:'+ version: 10.4.6(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])([email protected](@testing-library/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected])kea-test-utils:specifier: 'catalog:'version: 0.2.4([email protected](patch_hash=139b8d1f1304f9d9da452a9a1244c94ea679dbcb85687d8999563146879fb6f5)([email protected]))@@ -4874,7 +4880,7 @@ importers:version: 6.0.3vite-tsconfig-paths:specifier: ^5.1.4- version: 5.1.4([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))+ version: 5.1.4([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))vitest:specifier: ^3.2.4version: 3.2.6(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected]))([email protected])([email protected])([email protected])([email protected])@@ -4920,7 +4926,7 @@ importers:version: 6.0.3vite-tsconfig-paths:specifier: ^5.1.4- version: 5.1.4([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))+ version: 5.1.4([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))vitest:specifier: ^3.2.4version: 3.2.6(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected]))([email protected])([email protected])([email protected])([email protected])diff --git a/posthog/cdp/validation.py b/posthog/cdp/validation.pyindex 054c2b5df606..1fbaee4d8030 100644--- a/posthog/cdp/validation.py+++ b/posthog/cdp/validation.py@@ -35,6 +35,27 @@ MAX_WORKFLOW_EMAIL_SENDERS = 10# sends this back, meaning "keep the stored value". It must never be persisted as a real secret.MASKED_SECRET_VALUE = "********"++def masked_secret_input_keys(stored_inputs: object) -> list[str]:+ """Input keys whose stored secret is the mask rather than a real credential.++ Such an input authenticates against nothing, and the original value is gone, so only the+ owner can restore it. The match cannot be a SQL predicate: the storage column is Fernet+ encrypted, and Fernet embeds a random IV, so the same plaintext encrypts differently every+ write. Callers have to decrypt and inspect.++ A row encrypted under a key we no longer hold decrypts to the raw ciphertext string rather+ than a dict, because the field swallows the failure, so the shape is checked, not assumed.+ """+ if not isinstance(stored_inputs, dict):+ return []+ return sorted(+ key+ for key, entry in stored_inputs.items()+ if isinstance(entry, dict) and entry.get("value") == MASKED_SECRET_VALUE+ )++# Mirrors FROM_OVERRIDE_EMAIL_REGEX in nodejs/src/cdp/services/messaging/email.service.ts, which# is what the send path enforces after rendering. Keep the two in sync.FROM_OVERRIDE_EMAIL_REGEX = re.compile(r'^[^\s@"<>,;]+@[^\s@"<>,;]+\.[^\s@"<>,;]+$')diff --git a/products/cdp/backend/api/hog_function.py b/products/cdp/backend/api/hog_function.pyindex 41a21659f6de..f42e0a5f0873 100644--- a/products/cdp/backend/api/hog_function.py+++ b/products/cdp/backend/api/hog_function.py@@ -37,6 +37,7 @@ from posthog.cdp.validation import (MappingsSerializer,compile_hog,generate_template_bytecode,+ masked_secret_input_keys,)from posthog.event_usage import AGENT_EVENT_SOURCES, get_event_sourcefrom posthog.exceptions_capture import capture_exception@@ -888,6 +889,21 @@ class HogFunctionRearrangeSerializer(serializers.Serializer):)+class HogFunctionMaskedSecretSerializer(serializers.Serializer):+ id = serializers.UUIDField(help_text="ID of the hog function.")+ name = serializers.CharField(help_text="Name of the hog function.")+ type = serializers.CharField(help_text="Hog function type, for example 'destination'.")+ enabled = serializers.BooleanField(help_text="Whether the hog function is enabled.")+ input_keys = serializers.ListField(+ child=serializers.CharField(),+ help_text="Keys of the live secret inputs to enter again. Only keys are returned, never values.",+ )+ draft_input_keys = serializers.ListField(+ child=serializers.CharField(),+ help_text="Keys of the staged draft's secret inputs to enter again. Only keys are returned.",+ )++class CommaSeparatedListFilter(BaseInFilter, CharFilter):pass@@ -917,6 +933,7 @@ class HogFunctionViewSet("metrics_totals","revisions","revision_detail",+ "masked_secrets",]scope_object_write_actions = ["create",@@ -1052,6 +1069,47 @@ class HogFunctionViewSet(return icon_service.get_icon_http_response(id, team_id=self.team_id)+ @extend_schema(+ operation_id="hog_functions_masked_secrets_retrieve",+ responses=HogFunctionMaskedSecretSerializer(many=True),+ )+ @action(detail=False, methods=["GET"], pagination_class=None, filter_backends=[])+ def masked_secrets(self, request: Request, *args: Any, **kwargs: Any) -> Response:+ """+ Hog functions storing the secret mask in place of a real credential.++ Such a function authenticates against nothing and fails every send. The original value+ cannot be restored from our side, so each listed input has to be entered again.+ """+ affected = []+ # Access filtering runs only for the `list` action, and a detail route relies on object+ # permissions instead - a collection action like this one gets neither. Without this a+ # member restricted to some functions would learn which of the others hold a broken+ # credential, and under which input keys.+ accessible = self.user_access_control.filter_queryset_by_access_level(+ self.get_queryset(), resource="hog_function"+ )+ # Only the columns the scan reads: the rest include large text/JSON fields (hog, bytecode,+ # transpiled, draft, ...) that would be transferred and deserialized for every row for nothing.+ scan = accessible.only("id", "name", "type", "enabled", "encrypted_inputs", "draft_encrypted_inputs")+ for hog_function in scan.order_by("-updated_at").iterator(chunk_size=100):+ input_keys = masked_secret_input_keys(hog_function.encrypted_inputs)+ draft_input_keys = masked_secret_input_keys(hog_function.draft_encrypted_inputs)+ if not input_keys and not draft_input_keys:+ continue+ affected.append(+ {+ "id": hog_function.id,+ "name": hog_function.name or "",+ "type": hog_function.type or "",+ "enabled": hog_function.enabled,+ "input_keys": input_keys,+ "draft_input_keys": draft_input_keys,+ }+ )++ return Response(HogFunctionMaskedSecretSerializer(affected, many=True).data)+def _draft_test_configuration(self, hog_function: Optional[HogFunction]) -> dict:"""The staged draft as a test-invocable configuration: live config with the draft's contentfields on top, staged secrets rehydrated in plaintext so the test exercises what publishdiff --git a/products/cdp/backend/api/test/test_hog_function.py b/products/cdp/backend/api/test/test_hog_function.pyindex aeecc1020d6e..8b941b4a8aab 100644--- a/products/cdp/backend/api/test/test_hog_function.py+++ b/products/cdp/backend/api/test/test_hog_function.py@@ -805,6 +805,50 @@ class TestHogFunctionAPI(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):== "gAAAAABlkgC8AAAAAAAAAAAAAAAAAAAAAKvzDjuLG689YjjVhmmbXAtZSRoucXuT8VtokVrCotIx3ttPcVufoVt76dyr2phbuotMldKMVv_Y6uzMDZFjX1Uvej4GHsYRbsTN_txcQHNnU7zvLee83DhHIrThEjceoq8i7hbfKrvqjEi7GCGc_k_Gi3V5KFxDOfLKnke4KM4s")+ def test_masked_secrets_lists_only_functions_storing_the_mask(self, *args):+ secret_schema = [{"key": "api_key", "type": "string", "label": "API key", "secret": True, "required": True}]+ healthy = HogFunction.objects.create(+ team=self.team,+ name="Healthy",+ type="destination",+ enabled=True,+ inputs_schema=secret_schema,+ encrypted_inputs={"api_key": {"value": "I AM SECRET", "order": 0}},+ )+ poisoned = HogFunction.objects.create(+ team=self.team,+ name="Poisoned",+ type="destination",+ enabled=True,+ inputs_schema=secret_schema,+ encrypted_inputs={"api_key": {"value": "********", "order": 0}},+ )+ poisoned_draft = HogFunction.objects.create(+ team=self.team,+ name="Poisoned draft",+ type="destination",+ enabled=False,+ inputs_schema=secret_schema,+ encrypted_inputs={"api_key": {"value": "I AM SECRET", "order": 0}},+ draft_encrypted_inputs={"api_key": {"value": "********", "order": 0}},+ )++ response = self.client.get(f"/api/projects/{self.team.id}/hog_functions/masked_secrets/")+ assert response.status_code == status.HTTP_200_OK, response.json()++ results = {row["id"]: row for row in response.json()}+ assert set(results) == {str(poisoned.id), str(poisoned_draft.id)}+ assert str(healthy.id) not in results++ assert results[str(poisoned.id)]["input_keys"] == ["api_key"]+ assert results[str(poisoned.id)]["draft_input_keys"] == []+ assert results[str(poisoned.id)]["enabled"] is True+ assert results[str(poisoned_draft.id)]["input_keys"] == []+ assert results[str(poisoned_draft.id)]["draft_input_keys"] == ["api_key"]++ # The response is read by an incident banner in the browser, so it must carry keys only.+ assert "I AM SECRET" not in response.content.decode()+def test_secret_inputs_not_updated_if_not_changed(self, *args):payload = {"type": "destination",diff --git a/products/cdp/backend/services/masked_secrets.py b/products/cdp/backend/services/masked_secrets.pyindex 7c68309f9e3a..f317b885747c 100644--- a/products/cdp/backend/services/masked_secrets.py+++ b/products/cdp/backend/services/masked_secrets.py@@ -21,7 +21,7 @@ from uuid import UUIDfrom django.db.models import Model, Q, QuerySet-from posthog.cdp.validation import MASKED_SECRET_VALUE+from posthog.cdp.validation import MASKED_SECRET_VALUE, masked_secret_input_keysfrom posthog.dataclasses import frozenfrom posthog.utils import absolute_uri@@ -104,21 +104,8 @@ class HogFlowMaskedSecretScan:def _masked_input_keys(stored: object) -> tuple[str, ...]:- """Input keys whose stored value is the literal mask.-- A row encrypted under a key we no longer hold comes back as the raw ciphertext string rather- than a dict, because the field swallows `InvalidToken`. The shape has to be checked, not- assumed.- """- if not isinstance(stored, dict):- return ()- return tuple(- sorted(- key- for key, entry in stored.items()- if isinstance(entry, dict) and entry.get("value") == MASKED_SECRET_VALUE- )- )+ """The shared mask predicate, as the tuple the frozen finding dataclasses require."""+ return tuple(masked_secret_input_keys(stored))def _flow_masked_input_keys(stored: object) -> tuple[str, ...]:@@ -127,7 +114,7 @@ def _flow_masked_input_keys(stored: object) -> tuple[str, ...]:Hog flow secrets are keyed action id then input key. An entry is poisoned when it is the`{"secret": true}` read-back marker with no value — the save path should have swapped it forthe stored secret — or when its value is the literal mask string. Same shape caveat as- `_masked_input_keys`: an undecryptable row reads back as a raw string.+ `masked_secret_input_keys`: an undecryptable row reads back as a raw string."""if not isinstance(stored, dict):return ()diff --git a/products/cdp/frontend/DestinationsIncidentReplayBanner.stories.tsx b/products/cdp/frontend/DestinationsIncidentReplayBanner.stories.tsxnew file mode 100644index 000000000000..8712ed2ec072--- /dev/null+++ b/products/cdp/frontend/DestinationsIncidentReplayBanner.stories.tsx@@ -0,0 +1,76 @@+import { Meta, StoryObj } from '@storybook/react'++import { FEATURE_FLAGS } from 'lib/constants'+import { App } from 'scenes/App'+import { urls } from 'scenes/urls'++import { mswDecorator } from '~/mocks/browser'++const NEEDS_CREDENTIALS_ID = '0196b144-1f82-0000-0d0d-a01de54d674d'+const REPLAYABLE_ID = '0196b144-1f82-0000-0d0d-a01de54d6750'++const hogFunction = (id: string, name: string): Record<string, unknown> => ({+ id,+ name,+ type: 'destination',+ enabled: true,+ inputs_schema: [{ key: 'api_key', type: 'string', label: 'API key', secret: true }],+ inputs: {},+ filters: {},+ icon_url: null,+ created_at: '2026-08-01T00:00:00Z',+ updated_at: '2026-08-18T14:00:00Z',+})++const meta: Meta = {+ component: App,+ title: 'Scenes-App/Data pipelines/Destinations incident replay banner',+ parameters: {+ layout: 'fullscreen',+ viewMode: 'story',+ pageUrl: urls.destinations(),+ mockDate: '2026-08-21',+ featureFlags: [FEATURE_FLAGS.DESTINATIONS_INCIDENT_REPLAY],+ },+ decorators: [+ mswDecorator({+ get: {+ '/api/projects/:team_id/hog_functions/masked_secrets/': [+ {+ id: NEEDS_CREDENTIALS_ID,+ name: 'Customer.io',+ type: 'destination',+ enabled: true,+ input_keys: ['api_key'],+ draft_input_keys: [],+ },+ ],+ [`/api/projects/:team_id/hog_functions/${NEEDS_CREDENTIALS_ID}/`]: hogFunction(+ NEEDS_CREDENTIALS_ID,+ 'Customer.io'+ ),+ [`/api/projects/:team_id/hog_functions/${REPLAYABLE_ID}/`]: hogFunction(REPLAYABLE_ID, 'HubSpot'),+ '/api/projects/:team_id/hog_functions/': {+ count: 2,+ results: [hogFunction(NEEDS_CREDENTIALS_ID, 'Customer.io'), hogFunction(REPLAYABLE_ID, 'HubSpot')],+ next: null,+ },+ },+ post: {+ '/api/environments/:team_id/query/:query_kind/': {+ results: [+ [REPLAYABLE_ID, 12480],+ [NEEDS_CREDENTIALS_ID, 3106],+ ],+ },+ },+ }),+ ],+}+export default meta++type Story = StoryObj<{}>++// One destination still storing the mask and one already fixed, which is what the banner has to+// tell apart: the first can only be sent to its configuration, the second can be replayed.+export const Default: Story = {}diff --git a/products/cdp/frontend/DestinationsIncidentReplayBanner.tsx b/products/cdp/frontend/DestinationsIncidentReplayBanner.tsxnew file mode 100644index 000000000000..319645639ff4--- /dev/null+++ b/products/cdp/frontend/DestinationsIncidentReplayBanner.tsx@@ -0,0 +1,125 @@+import { useActions, useValues } from 'kea'++import { LemonBanner, LemonButton, LemonDialog } from '@posthog/lemon-ui'++import { humanFriendlyNumber } from 'lib/utils/numbers'+import { isRerunnableHogFunctionType } from 'scenes/hog-functions/invocations/hogInvocationsLogic'+import { urls } from 'scenes/urls'++import { type AffectedDestination, destinationsIncidentReplayLogic } from './destinationsIncidentReplayLogic'++// Mirrors the server-side HOG_INVOCATION_RERUN_MAX_COUNT default: one replay request queues at+// most this many invocations, so a busier destination needs a second pass.+const RERUN_MAX_COUNT_PER_REQUEST = 10000++function replayBlockedReason(destination: AffectedDestination): string | undefined {+ if (!destination.enabled) {+ return 'This destination is disabled. Enable it to replay its failed events.'+ }+ if (!isRerunnableHogFunctionType(destination.type)) {+ return 'This type of destination cannot be replayed.'+ }+ if (destination.failedCount === 0) {+ return 'There is nothing left to replay.'+ }+ return undefined+}++/**+ * A replay sends real events to the third party, so it gets the same confirmation the per-invocation+ * and bulk rerun buttons already use. It matters more here: one click covers the whole backlog.+ */+function confirmReplay(destination: AffectedDestination, replayDestination: (id: string) => void): void {+ LemonDialog.open({+ title: `Replay failed events for ${destination.name || 'this destination'}?`,+ content: `This sends ${humanFriendlyNumber(destination.failedCount)} failed ${+ destination.failedCount === 1 ? 'event' : 'events'+ } to the destination again, starting from August 18. Events the destination already processed are sent a second time.`,+ primaryButton: {+ children: 'Replay',+ onClick: () => replayDestination(destination.id),+ },+ secondaryButton: { children: 'Cancel' },+ })+}++export function DestinationsIncidentReplayBanner(): JSX.Element | null {+ const { showBanner, affectedDestinations, replayStatusById, currentProjectId } = useValues(+ destinationsIncidentReplayLogic+ )+ const { replayDestination } = useActions(destinationsIncidentReplayLogic)++ if (!showBanner) {+ return null+ }++ const hasLargeBacklog = affectedDestinations.some(+ (destination) => destination.failedCount > RERUN_MAX_COUNT_PER_REQUEST+ )++ return (+ <LemonBanner+ type="warning"+ // Per project: without the suffix, dismissing in one project hides the recovery path+ // in every other project this browser visits.+ dismissKey={`destinations-incident-replay-2026-08-18-${currentProjectId}`}+ >+ {/* LemonBanner takes no data-attr, so the hook for autocapture and tests sits here. */}+ <div className="flex flex-col gap-2" data-attr="destinations-incident-replay-banner">+ <div>+ On August 18 an incident on our side replaced the saved credentials on some destinations with a+ placeholder, so their events stopped being delivered. We can't recover the original values. Any+ destination below marked "Enter credentials" is affected, and needs its credentials again. The rest+ have events that failed since August 18, which may or may not be related, and you can replay those.+ {hasLargeBacklog ? (+ <> A replay covers up to 10,000 failed events per run. Replay again to send the rest.</>+ ) : null}+ </div>+ <ul className="flex flex-col gap-1">+ {affectedDestinations.map((destination) => {+ const status = replayStatusById[destination.id]+ const blockedReason = replayBlockedReason(destination)+ return (+ <li key={destination.id} className="flex items-center gap-2">+ {destination.needsCredentials ? (+ <LemonButton+ type="secondary"+ size="xsmall"+ data-attr="destinations-incident-credentials-button"+ to={urls.hogFunction(destination.id, 'configuration')}+ >+ Enter credentials+ </LemonButton>+ ) : (+ <LemonButton+ type="secondary"+ size="xsmall"+ data-attr="destinations-incident-replay-button"+ loading={status === 'pending'}+ disabledReason={+ status === 'queued'+ ? 'Replay queued. Refresh the page to replay again once it finishes.'+ : blockedReason+ }+ onClick={() => confirmReplay(destination, replayDestination)}+ >+ {status === 'queued' ? 'Replay queued' : 'Replay failed events'}+ </LemonButton>+ )}+ <LemonButton size="xsmall" to={urls.hogFunction(destination.id, 'configuration')}>+ {destination.name}+ </LemonButton>+ {destination.failedCount > 0 ? (+ <span className="text-secondary">+ {humanFriendlyNumber(destination.failedCount)} failed{' '}+ {destination.failedCount === 1 ? 'event' : 'events'}+ </span>+ ) : null}+ </li>+ )+ })}+ </ul>+ </div>+ </LemonBanner>+ )+}diff --git a/products/cdp/frontend/destinationsIncidentReplayLogic.test.ts b/products/cdp/frontend/destinationsIncidentReplayLogic.test.tsnew file mode 100644index 000000000000..6fe6066d5aa3--- /dev/null+++ b/products/cdp/frontend/destinationsIncidentReplayLogic.test.ts@@ -0,0 +1,180 @@+import { expectLogic } from 'kea-test-utils'++import { useMocks } from '~/mocks/jest'+import { initKeaTests } from '~/test/init'++import {+ destinationsIncidentReplayLogic,+ incidentCountWindowStart,+ incidentReplayWindow,+} from './destinationsIncidentReplayLogic'++const MASKED_ONLY_ID = '019d244c-42c9-0000-ec6c-752c8b265c4f'+const FAILED_ONLY_ID = '019d9146-223a-0000-8165-1a3489e88b3d'+const DELETED_ID = '019f3834-8dbd-0000-4b19-073031109b21'+const NO_SECRET_ID = '019f3834-8dbd-0000-4b19-073031109b22'++const SECRET_SCHEMA = [{ key: 'api_key', type: 'string', label: 'API key', secret: true }]+const INTEGRATION_SCHEMA = [{ key: 'slack_workspace', type: 'integration', label: 'Slack workspace' }]++describe('destinationsIncidentReplayLogic', () => {+ let logic: ReturnType<typeof destinationsIncidentReplayLogic.build>++ beforeEach(() => {+ useMocks({+ post: {+ '/api/environments/:team_id/query/:query_kind/': () => [+ 200,+ {+ results: [+ [FAILED_ONLY_ID, 224],+ [NO_SECRET_ID, 91],+ [DELETED_ID, 3],+ ],+ },+ ],+ },+ get: {+ '/api/projects/:team_id/hog_functions/masked_secrets/': () => [+ 200,+ [+ {+ id: MASKED_ONLY_ID,+ name: 'Customer.io',+ type: 'destination',+ enabled: true,+ input_keys: ['api_key'],+ draft_input_keys: [],+ },+ ],+ ],+ '/api/projects/:team_id/hog_functions/:id/': (req) => {+ if (req.params.id === MASKED_ONLY_ID) {+ return [+ 200,+ {+ id: MASKED_ONLY_ID,+ name: 'Customer.io',+ type: 'destination',+ enabled: true,+ inputs_schema: SECRET_SCHEMA,+ },+ ]+ }+ if (req.params.id === FAILED_ONLY_ID) {+ return [+ 200,+ {+ id: FAILED_ONLY_ID,+ name: 'HubSpot',+ type: 'destination',+ enabled: true,+ inputs_schema: SECRET_SCHEMA,+ },+ ]+ }+ if (req.params.id === NO_SECRET_ID) {+ return [+ 200,+ {+ id: NO_SECRET_ID,+ name: 'Slack',+ type: 'destination',+ enabled: true,+ inputs_schema: INTEGRATION_SCHEMA,+ },+ ]+ }+ return [404, { detail: 'Not found.' }]+ },+ },+ })+ initKeaTests()+ logic = destinationsIncidentReplayLogic()+ logic.mount()+ })++ it('excludes a failing destination that holds no secret the incident could clear', async () => {+ await expectLogic(logic, () => logic.actions.loadAffectedDestinations()).toDispatchActions([+ 'loadAffectedDestinationsSuccess',+ ])++ expect(logic.values.affectedDestinations.map((row) => row.id)).not.toContain(NO_SECRET_ID)+ })++ it('lists destinations found by either signal and drops deleted ones', async () => {+ await expectLogic(logic, () => logic.actions.loadAffectedDestinations()).toDispatchActions([+ 'loadAffectedDestinationsSuccess',+ ])++ expect(logic.values.affectedDestinations).toEqual([+ {+ id: FAILED_ONLY_ID,+ name: 'HubSpot',+ type: 'destination',+ failedCount: 224,+ needsCredentials: false,+ enabled: true,+ },+ {+ id: MASKED_ONLY_ID,+ name: 'Customer.io',+ type: 'destination',+ failedCount: 0,+ needsCredentials: true,+ enabled: true,+ },+ ])+ })++ it('still surfaces the recovery path when the failed-count query errors', async () => {+ useMocks({+ post: {+ '/api/environments/:team_id/query/:query_kind/': () => [500, { detail: 'Query timed out' }],+ },+ })++ await expectLogic(logic, () => logic.actions.loadAffectedDestinations()).toDispatchActions([+ 'loadAffectedDestinationsSuccess',+ ])++ expect(logic.values.affectedDestinations).toEqual([+ {+ id: MASKED_ONLY_ID,+ name: 'Customer.io',+ type: 'destination',+ failedCount: 0,+ needsCredentials: true,+ enabled: true,+ },+ ])+ })++ describe('incidentCountWindowStart', () => {+ // The replay sends the incident start as UTC. If the count read it as team-local wall time+ // instead, the two would cover spans a whole timezone offset apart.+ it('renders the same instant the replay sends, in the team timezone', () => {+ expect(incidentCountWindowStart('UTC')).toEqual('2026-08-18 13:30:00.000')+ expect(incidentCountWindowStart('US/Pacific')).toEqual('2026-08-18 06:30:00.000')+ expect(incidentCountWindowStart('Europe/Berlin')).toEqual('2026-08-18 15:30:00.000')+ })+ })++ describe('incidentReplayWindow', () => {+ it('uses the incident start while the incident is within the 30-day cap', () => {+ expect(incidentReplayWindow(new Date('2026-08-25T00:00:00.000Z'))).toEqual({+ window_start: '2026-08-18T13:30:00.000Z',+ window_end: '2026-08-25T00:00:00.000Z',+ })+ })++ it('clamps the start to 30 days once the incident is older than the cap', () => {+ const { window_start, window_end } = incidentReplayWindow(new Date('2026-10-01T00:00:00.000Z'))+ expect(window_start).toEqual('2026-09-01T00:00:00.000Z')+ expect(window_end).toEqual('2026-10-01T00:00:00.000Z')+ // Stays within the rerun endpoint's 30-day cap, so the request is not rejected.+ const spanDays = (new Date(window_end).getTime() - new Date(window_start).getTime()) / (24 * 60 * 60 * 1000)+ expect(spanDays).toBeLessThanOrEqual(30)+ })+ })+})diff --git a/products/cdp/frontend/destinationsIncidentReplayLogic.ts b/products/cdp/frontend/destinationsIncidentReplayLogic.tsnew file mode 100644index 000000000000..4634a1d664ed--- /dev/null+++ b/products/cdp/frontend/destinationsIncidentReplayLogic.ts@@ -0,0 +1,333 @@+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'+import { loaders } from 'kea-loaders'+import { subscriptions } from 'kea-subscriptions'++import api from 'lib/api'+import { FEATURE_FLAGS } from 'lib/constants'+import { dayjs } from 'lib/dayjs'+import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'+import { featureFlagLogic, type FeatureFlagsSet } from 'lib/logic/featureFlagLogic'+import { projectTimezoneOf } from 'scenes/hog-functions/invocations/hogInvocationsLogic'+import { projectLogic } from 'scenes/projectLogic'+import { teamLogic } from 'scenes/teamLogic'++import { hogql } from '~/queries/utils'+import type { HogFunctionTypeType } from '~/types'++import { hogFunctionsMaskedSecretsRetrieve, hogFunctionsRerunCreate, hogFunctionsRetrieve } from './generated/api'+import type { HogFunctionApi } from './generated/api.schemas'++// Deploy time of the change that started overwriting stored secrets with the mask, rounded down+// from the two regional deploys (13:34 UTC in EU, 13:35 in US). Failures do not stop at a fix+// deploy the way an ordinary regression's do - they stop when the owner enters the credential+// again - so the window has no fixed end and runs up to the moment of the replay.+const INCIDENT_WINDOW_START = '2026-08-18T13:30:00.000Z'++// The rerun endpoint rejects a window wider than 30 days (RERUN_MAX_WINDOW_DAYS in+// posthog/api/hog_invocation_rerun.py), a cap that tracks the 30-day ClickHouse TTL on the failed+// rows. Once the incident is more than 30 days old the fixed start above would push the window past+// that cap and every replay would 400 while the banner still shows a working button. The clamped-off+// span holds only rows the TTL has already dropped, so nothing replayable is lost.+const REPLAY_MAX_WINDOW_DAYS = 30+const MS_PER_DAY = 24 * 60 * 60 * 1000++// Clamp the replay start to the later of the incident start and 30 days before now, so the window+// sent to the rerun endpoint never exceeds its cap. Exported for the unit test.+export function incidentReplayWindow(now: Date): { window_start: string; window_end: string } {+ const earliestStart = new Date(now.getTime() - REPLAY_MAX_WINDOW_DAYS * MS_PER_DAY)+ const incidentStart = new Date(INCIDENT_WINDOW_START)+ const windowStart = incidentStart > earliestStart ? incidentStart : earliestStart+ return { window_start: windowStart.toISOString(), window_end: now.toISOString() }+}++// One row per destination, so a project with a long tail of unrelated failures would otherwise+// render a wall of them. Ordered by failure count, so the cut keeps the rows worth showing.+const MAX_LISTED_DESTINATIONS = 20++export interface AffectedDestination {+ id: string+ name: string+ type: HogFunctionTypeType | null+ failedCount: number+ /** The stored secret is still the mask, so a replay would fail against the third party again. */+ needsCredentials: boolean+ enabled: boolean+}++export type ReplayStatus = 'pending' | 'queued'++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface destinationsIncidentReplayLogicValues {+ featureFlags: FeatureFlagsSet // featureFlagLogic+ currentProjectId: number | null // projectLogic+ affectedDestinations: AffectedDestination[]+ affectedDestinationsLoading: boolean+ replayStatusById: Record<string, ReplayStatus>+ showBanner: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface destinationsIncidentReplayLogicActions {+ loadAffectedDestinations: () => any+ loadAffectedDestinationsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadAffectedDestinationsSuccess: (+ affectedDestinations: {+ enabled: boolean+ failedCount: number+ id: string+ name: string+ needsCredentials: boolean+ type: HogFunctionTypeType | null+ }[],+ payload?: any+ ) => {+ affectedDestinations: {+ enabled: boolean+ failedCount: number+ id: string+ name: string+ needsCredentials: boolean+ type: HogFunctionTypeType | null+ }[]+ payload?: any+ }+ replayDestination: (id: string) => {+ id: string+ }+ replayDestinationFailure: (id: string) => {+ id: string+ }+ replayDestinationSuccess: (id: string) => {+ id: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface destinationsIncidentReplayLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ showBanner: (featureFlags: FeatureFlagsSet, affectedDestinations: AffectedDestination[]) => boolean+ }+}++export type destinationsIncidentReplayLogicType = MakeLogicType<+ destinationsIncidentReplayLogicValues,+ destinationsIncidentReplayLogicActions,+ Record<string, any>,+ destinationsIncidentReplayLogicMeta+>++/** Whether the destination stores a credential of its own, which is what the incident could clear. */+function hasSecretInput(hogFunction: HogFunctionApi): boolean {+ return (hogFunction.inputs_schema ?? []).some((schema) => schema.secret)+}++/**+ * The incident start as a `scheduled_at` literal, in the team's timezone.+ *+ * Not `dateClauseFor`: that runs the bound through `dayjs.tz(value, zone)`, which reads the string+ * as wall time in the team's zone and discards the `Z`. The instant would shift by the team's+ * offset, so the count would cover a different span than the replay, which sends the same boundary+ * as UTC. Parsing as UTC first and rendering in the team's zone keeps the two in step.+ *+ * Exported for the unit test.+ */+export function incidentCountWindowStart(timezone: string): string {+ return dayjs(INCIDENT_WINDOW_START).tz(timezone).format('YYYY-MM-DD HH:mm:ss.SSS')+}++/**+ * Counts, per destination, the invocations whose latest status is still failed since the incident+ * began. One query rather than one per destination, and it doubles as the discovery step.+ *+ * There is deliberately no upper bound on `scheduled_at`: a replay writes its lifecycle rows into+ * the partition of the replay time, not the original one. Collapsing every partition from the+ * incident start onwards is what makes a recovered invocation read as succeeded, so a count shrinks+ * as a replay drains and the destination leaves the banner when it reaches zero. Leaving the bound+ * off also keeps the query text stable between mounts, which a `< now` bound did not.+ */+async function loadFailedCountsByDestination(): Promise<Map<string, number>> {+ const timezone = projectTimezoneOf(teamLogic.findMounted()?.values.currentTeam)+ const dateClause = hogql.raw(`AND scheduled_at >= '${incidentCountWindowStart(timezone)}'`)+ const query = hogql`+ SELECT function_id, count() AS failed_count FROM (+ SELECT+ function_id,+ invocation_id+ FROM posthog.hog_invocation_results+ WHERE function_kind = 'hog_function'+ ${dateClause}+ GROUP BY function_id, invocation_id+ HAVING argMax(is_deleted, version) = 0+ AND argMax(status, version) = 'failed'+ )+ GROUP BY function_id+ ORDER BY failed_count DESC+ LIMIT ${MAX_LISTED_DESTINATIONS}+ `+ const response = await api.queryHogQL(query, {+ scene: 'DestinationsIncidentReplay',+ productKey: 'pipeline_destinations',+ })++ const counts = new Map<string, number>()+ response.results?.forEach((row) => {+ if (Array.isArray(row) && row[0]) {+ counts.set(String(row[0]), Number(row[1] ?? 0))+ }+ })+ return counts+}++export const destinationsIncidentReplayLogic = kea<destinationsIncidentReplayLogicType>([+ path(['products', 'cdp', 'frontend', 'destinationsIncidentReplayLogic']),+ connect(() => ({+ values: [projectLogic, ['currentProjectId'], featureFlagLogic, ['featureFlags']],+ })),+ actions({+ replayDestination: (id: string) => ({ id }),+ replayDestinationSuccess: (id: string) => ({ id }),+ replayDestinationFailure: (id: string) => ({ id }),+ }),+ loaders(({ values }) => ({+ affectedDestinations: [+ [] as AffectedDestination[],+ {+ loadAffectedDestinations: async () => {+ if (!values.currentProjectId) {+ return []+ }+ const projectId = String(values.currentProjectId)++ // Two independent signals, because neither covers the whole recovery on its+ // own. A destination still storing the mask is definitely broken, even with no+ // traffic yet. One with failures but no mask has either had its credential+ // entered again already, or broke for its own reasons - either way its failed+ // invocations are still sitting there to replay.+ //+ // The masked-secrets lookup is the primary recovery signal and cheap, so its+ // failure still fails the load. The failed-count query is heavy and its window+ // grows daily, so a timeout on it must not hide the "Enter credentials" rows the+ // masked-secrets signal builds on its own.+ const [maskedSecrets, failedCounts] = await Promise.all([+ hogFunctionsMaskedSecretsRetrieve(projectId),+ loadFailedCountsByDestination().catch(() => new Map<string, number>()),+ ])++ const maskedIds = new Set(maskedSecrets.map((row) => String(row.id)))+ const candidateIds = [...new Set([...maskedIds, ...failedCounts.keys()])]+ if (candidateIds.length === 0) {+ return []+ }++ // Fetch each destination by ID rather than intersecting with the list endpoint,+ // which caps at a page size: in a project with more destinations than one page+ // the affected ones can fall outside it and silently drop off the banner. Only a+ // definitive 403 (no access) or 404 (hard-deleted, nothing to replay) drops a+ // row. A transient failure keeps it, so a blip never hides the recovery path.+ const dropped = new Set<string>()+ const fetched = await Promise.all(+ candidateIds.map(async (id) => {+ try {+ return await hogFunctionsRetrieve(projectId, id)+ } catch (error) {+ const status = (error as { status?: number }).status+ if (status === 403 || status === 404) {+ dropped.add(id)+ }+ return null+ }+ })+ )+ const byId = new Map(+ fetched+ .filter((hogFunction): hogFunction is HogFunctionApi => hogFunction !== null)+ .map((hogFunction) => [String(hogFunction.id), hogFunction])+ )++ return (+ candidateIds+ .filter((id) => !dropped.has(id))+ // A destination with no secret input never held a credential we could clear,+ // so a failure on it belongs to the destination, not to this incident. This+ // drops every OAuth-backed destination (Slack, ads, Discord, Linear, GitHub),+ // whose credentials live on the Integration record. A destination we could+ // not fetch stays: an unknown schema must not hide a real recovery path.+ .filter((id) => {+ const hogFunction = byId.get(id)+ return maskedIds.has(id) || !hogFunction || hasSecretInput(hogFunction)+ })+ .map((id) => {+ const hogFunction = byId.get(id)+ const maskedRow = maskedSecrets.find((row) => String(row.id) === id)+ return {+ id,+ name: hogFunction?.name ?? maskedRow?.name ?? '',+ type: (hogFunction?.type ?? maskedRow?.type ?? null) as HogFunctionTypeType | null,+ failedCount: failedCounts.get(id) ?? 0,+ needsCredentials: maskedIds.has(id),+ enabled: hogFunction?.enabled ?? maskedRow?.enabled ?? false,+ }+ })+ .sort((a, b) => b.failedCount - a.failedCount)+ )+ },+ },+ ],+ })),+ reducers({+ replayStatusById: [+ {} as Record<string, ReplayStatus>,+ {+ replayDestination: (state, { id }) => ({ ...state, [id]: 'pending' }),+ replayDestinationSuccess: (state, { id }) => ({ ...state, [id]: 'queued' }),+ replayDestinationFailure: (state, { id }) => {+ const { [id]: _discarded, ...rest } = state+ return rest+ },+ },+ ],+ }),+ selectors({+ showBanner: [+ (s) => [s.featureFlags, s.affectedDestinations],+ (featureFlags: FeatureFlagsSet, affectedDestinations: AffectedDestination[]): boolean =>+ !!featureFlags[FEATURE_FLAGS.DESTINATIONS_INCIDENT_REPLAY] && affectedDestinations.length > 0,+ ],+ }),+ listeners(({ actions, values }) => ({+ replayDestination: async ({ id }) => {+ if (!values.currentProjectId) {+ actions.replayDestinationFailure(id)+ return+ }+ try {+ await hogFunctionsRerunCreate(String(values.currentProjectId), id, {+ filter: incidentReplayWindow(new Date()),+ })+ actions.replayDestinationSuccess(id)+ lemonToast.success('Replay queued. Failed events will be sent again shortly.')+ } catch {+ actions.replayDestinationFailure(id)+ lemonToast.error("Couldn't queue the replay. Try again, and contact support if it keeps happening.")+ }+ },+ })),+ // A subscription instead of afterMount: flags can resolve after the logic mounts, and a+ // one-time mount check would then never load. This fires with the value at mount and again+ // when the flag flips on, so only flagged teams pay for the lookup query.+ subscriptions(({ actions }) => ({+ featureFlags: (featureFlags: FeatureFlagsSet, oldFeatureFlags: FeatureFlagsSet | undefined) => {+ const isOn = !!featureFlags[FEATURE_FLAGS.DESTINATIONS_INCIDENT_REPLAY]+ const wasOn = !!oldFeatureFlags?.[FEATURE_FLAGS.DESTINATIONS_INCIDENT_REPLAY]+ if (isOn && !wasOn) {+ actions.loadAffectedDestinations()+ }+ },+ })),+])diff --git a/products/cdp/frontend/generated/api.schemas.ts b/products/cdp/frontend/generated/api.schemas.tsindex b8b34f13f7b1..f73727b1cd89 100644--- a/products/cdp/frontend/generated/api.schemas.ts+++ b/products/cdp/frontend/generated/api.schemas.ts@@ -749,6 +749,21 @@ export interface HogFunctionRevisionRestoreRequestApi {overwrite?: boolean}+export interface HogFunctionMaskedSecretApi {+ /** ID of the hog function. */+ id: string+ /** Name of the hog function. */+ name: string+ /** Hog function type, for example 'destination'. */+ type: string+ /** Whether the hog function is enabled. */+ enabled: boolean+ /** Keys of the live secret inputs to enter again. Only keys are returned, never values. */+ input_keys: string[]+ /** Keys of the staged draft's secret inputs to enter again. Only keys are returned. */+ draft_input_keys: string[]+}+/*** Map of hog function UUIDs to their new execution_order values.*/diff --git a/products/cdp/frontend/generated/api.ts b/products/cdp/frontend/generated/api.tsindex f02874ece8bd..c437daf8ea09 100644--- a/products/cdp/frontend/generated/api.ts+++ b/products/cdp/frontend/generated/api.ts@@ -13,6 +13,7 @@ import type {AppMetricsTotalsResponseApi,HogFunctionApi,HogFunctionInvocationApi,+ HogFunctionMaskedSecretApi,HogFunctionPublishRequestApi,HogFunctionPublishResponseApi,HogFunctionRevisionApi,@@ -500,6 +501,26 @@ export const hogFunctionsIconsRetrieve = async (projectId: string, options?: Req})}+export const getHogFunctionsMaskedSecretsRetrieveUrl = (projectId: string) => {+ return `/api/projects/${projectId}/hog_functions/masked_secrets/`+}++/**+ * Hog functions storing the secret mask in place of a real credential.+ *+ * Such a function authenticates against nothing and fails every send. The original value+ * cannot be restored from our side, so each listed input has to be entered again.+ */+export const hogFunctionsMaskedSecretsRetrieve = async (+ projectId: string,+ options?: RequestInit+): Promise<HogFunctionMaskedSecretApi[]> => {+ return apiMutator<HogFunctionMaskedSecretApi[]>(getHogFunctionsMaskedSecretsRetrieveUrl(projectId), {+ ...options,+ method: 'GET',+ })+}+export const getHogFunctionsRearrangePartialUpdateUrl = (projectId: string) => {return `/api/projects/${projectId}/hog_functions/rearrange/`}diff --git a/products/cdp/package.json b/products/cdp/package.jsonindex 0bb38269fb21..a8a559f26126 100644--- a/products/cdp/package.json+++ b/products/cdp/package.json@@ -5,9 +5,11 @@},"dependencies": {"kea": "catalog:",- "kea-loaders": "catalog:"+ "kea-loaders": "catalog:",+ "kea-subscriptions": "catalog:"},"devDependencies": {+ "@storybook/react": "catalog:","kea-test-utils": "catalog:"},"peerDependencies": {diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 8e92ec94fc4a..21071e59ff51 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -41261,6 +41261,21 @@ export namespace Schemas {invocation_id?: string | null;}+ export interface HogFunctionMaskedSecret {+ /** ID of the hog function. */+ id: string;+ /** Name of the hog function. */+ name: string;+ /** Hog function type, for example 'destination'. */+ type: string;+ /** Whether the hog function is enabled. */+ enabled: boolean;+ /** Keys of the live secret inputs to enter again. Only keys are returned, never values. */+ input_keys: string[];+ /** Keys of the staged draft's secret inputs to enter again. Only keys are returned. */+ draft_input_keys: string[];+ }+export interface HogFunctionMinimal {readonly id: string;/** @nullable */