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.

feat(data-warehouse): offer source destinations where batch exports are set up (#112443)

Tom Owers4fe37d029ebc
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 6bc5e43d6013..338dd661867b 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -2828,6 +2828,14 @@ snapshots:
hash: v1.k794b7964.493527f984dd150ed9590df45c866637a56287c585d69cdcf411ef5bce24dbf8.ocw1FaRlbBWs5pDrll11AbuJkknCONuxdXMhz365RB4
data-warehouse-sourcecatalogskeleton--narrow-scene--light:
hash: v1.k794b7964.b40c7d9b2dec21673858a8d0dc300b4e25d437140ac3c795e904cfff09934683.LIlhXoMvI575ZULUieEZGXzmVaeYYgk1mWwvjsbNC9U
+ data-warehouse-sourcedestinationsbanner--default--dark:
+ hash: v1.k794b7964.ff535a74651a80b0189c8eb55c97d1289f6143bbdbb3cc46e0bc6c18a8f84161.z7IdJ_UhwMwxzcPtydYbQLbC5MZHWx1uut_ozbY1VUA
+ data-warehouse-sourcedestinationsbanner--default--light:
+ hash: v1.k794b7964.1f6a5b602d0fddce79e8c6e97ea487ee1575eac67662e5a7a7cd028b40c57a12.rNQbMly6nX6cFn_3TZbvXxbRIOW8MWc5Y9vLbYI9GJc
+ data-warehouse-sourcedestinationsbanner--flag-off--dark:
+ hash: v1.k794b7964.9a49a8f585bc19a5cfa16e18daa7451cd12e8581406a5b65ef3ffaffa925d374.unCVrr9wwOp9AC6sc8cpWb4M69fcGVV214aEygIfO6I
+ data-warehouse-sourcedestinationsbanner--flag-off--light:
+ hash: v1.k794b7964.48c6b225dec1945c20d154de4f18c40be7b0c4f34c4b337878243bf984816e16.-vKIJKAdSQSKB0z_IMuQYV4bY1tzFQwajwGoiiB2TGg
data-warehouse-warehousedestinationstable--default--dark:
hash: v1.k794b7964.6595934174706ea9708694fdfe156d472e769213d8c3d41c59c0678447d20710.ZjAq0JuruCScBFFZXbK-MCQwdIrHPU50EmeRJGlFupY
data-warehouse-warehousedestinationstable--default--light:
diff --git a/frontend/src/scenes/data-pipelines/DestinationsBatchExportsTab.tsx b/frontend/src/scenes/data-pipelines/DestinationsBatchExportsTab.tsx
index 560c0bc75e55..e6e4f3e4d1f6 100644
--- a/frontend/src/scenes/data-pipelines/DestinationsBatchExportsTab.tsx
+++ b/frontend/src/scenes/data-pipelines/DestinationsBatchExportsTab.tsx
@@ -6,6 +6,8 @@ import { SceneContent } from '~/layout/scenes/components/SceneContent'
import { SceneDivider } from '~/layout/scenes/components/SceneDivider'
import { SceneSection } from '~/layout/scenes/components/SceneSection'
+import { SourceDestinationsBanner } from 'products/warehouse_sources/frontend/components/SourceDestinationsBanner'
+
import { BatchExportsList } from './batch-exports/BatchExportsList'
import { nonHogFunctionTemplatesLogic } from './utils/nonHogFunctionTemplatesLogic'
@@ -14,6 +16,7 @@ export function DestinationsBatchExportsTab(): JSX.Element {
return (
<SceneContent>
+ <SourceDestinationsBanner />
<SceneSection>
<BatchExportsList />
</SceneSection>
diff --git a/frontend/src/scenes/data-pipelines/batch-exports/BatchExportConfiguration.tsx b/frontend/src/scenes/data-pipelines/batch-exports/BatchExportConfiguration.tsx
index 59a2b3a517c8..05be4c8e62c3 100644
--- a/frontend/src/scenes/data-pipelines/batch-exports/BatchExportConfiguration.tsx
+++ b/frontend/src/scenes/data-pipelines/batch-exports/BatchExportConfiguration.tsx
@@ -29,6 +29,8 @@ import {
IntegrationType,
} from '~/types'
+import { SourceDestinationsBanner } from 'products/warehouse_sources/frontend/components/SourceDestinationsBanner'
+
import { batchExportConfigFormLogic } from './batchExportConfigFormLogic'
import {
BatchExportConfigurationClearChangesButton,
@@ -73,6 +75,7 @@ export function BatchExportConfiguration(): JSX.Element {
return (
<Form logic={batchExportConfigFormLogic} formKey="configuration" className="flex flex-col gap-3">
+ <SourceDestinationsBanner />
<div className="flex flex-wrap gap-4 items-start">
<div className="flex flex-col flex-1 max-w-200 min-w-100 gap-y-3">
<div className="flex flex-col p-3 rounded border bg-surface-primary gap-y-2">
diff --git a/products/warehouse_sources/frontend/components/SourceDestinationsBanner.stories.tsx b/products/warehouse_sources/frontend/components/SourceDestinationsBanner.stories.tsx
new file mode 100644
index 000000000000..d30d846e8688
--- /dev/null
+++ b/products/warehouse_sources/frontend/components/SourceDestinationsBanner.stories.tsx
@@ -0,0 +1,35 @@
+import { Meta, StoryFn } from '@storybook/react'
+
+import { FEATURE_FLAGS } from 'lib/constants'
+
+import { SourceDestinationsBanner } from './SourceDestinationsBanner'
+
+const meta: Meta<typeof SourceDestinationsBanner> = {
+ title: 'Data Warehouse/SourceDestinationsBanner',
+ component: SourceDestinationsBanner,
+ parameters: {
+ featureFlags: [FEATURE_FLAGS.WAREHOUSE_MULTI_DESTINATION],
+ },
+ tags: ['autodocs'],
+}
+export default meta
+
+// LemonBanner is a CSS container, so it collapses to its content's minimum width without an
+// explicitly sized parent - `#storybook-root` is `display: inline-block` and gives it none.
+const Template: StoryFn<typeof SourceDestinationsBanner> = () => (
+ <div className="w-200">
+ <SourceDestinationsBanner />
+ </div>
+)
+
+export const Default = Template.bind({})
+
+// Keep a sized story root so visual tests can verify the banner stays absent without the flag.
+// `#storybook-root` is `display: inline-block`, so it needs an explicit width as well as height -
+// a height-only box still collapses to zero width and the screenshot target stays invisible.
+export const FlagOff: StoryFn<typeof SourceDestinationsBanner> = () => (
+ <div className="h-px w-px">
+ <SourceDestinationsBanner />
+ </div>
+)
+FlagOff.parameters = { featureFlags: [] }
diff --git a/products/warehouse_sources/frontend/components/SourceDestinationsBanner.tsx b/products/warehouse_sources/frontend/components/SourceDestinationsBanner.tsx
new file mode 100644
index 000000000000..ca73754b617a
--- /dev/null
+++ b/products/warehouse_sources/frontend/components/SourceDestinationsBanner.tsx
@@ -0,0 +1,39 @@
+import { useValues } from 'kea'
+
+import { LemonBanner } from '@posthog/lemon-ui'
+
+import { FEATURE_FLAGS } from 'lib/constants'
+import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
+import { urls } from 'scenes/urls'
+
+/** Points someone looking at their own warehouse at the other half of the same connection.
+ *
+ * Batch exports and warehouse source destinations write to the same seven warehouses from the
+ * same saved connections, so a person who has connected one for exports has already done the
+ * work to receive imported rows there too, and usually does not know it.
+ */
+export function SourceDestinationsBanner(): JSX.Element | null {
+ const { featureFlags } = useValues(featureFlagLogic)
+
+ // The destinations scene is behind the same flag, so without it this would offer a dead link.
+ if (!featureFlags[FEATURE_FLAGS.WAREHOUSE_MULTI_DESTINATION]) {
+ return null
+ }
+
+ return (
+ <LemonBanner
+ type="info"
+ dismissKey="warehouse-source-destinations-cross-sell"
+ action={{
+ children: 'Get started',
+ // Sources, not destinations: a destination is turned on from the source that
+ // feeds it, so the destinations page would only tell a reader to go here.
+ to: urls.sources(),
+ 'data-attr': 'warehouse-destinations-cross-sell',
+ }}
+ >
+ PostHog also runs ELT pipelines. A pipeline imports tables from a source like Stripe or HubSpot, and can
+ write them to the same warehouse you export to, over the same connection.
+ </LemonBanner>
+ )
+}