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
24 changes: 24 additions & 0 deletions apps/docs/components/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4258,6 +4258,30 @@ export function PackageSearchIcon(props: SVGProps<SVGSVGElement>) {
</svg>
)
}
export function OrganizationSearchIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
{...props}
xmlns='http://www.w3.org/2000/svg'
width='24'
height='24'
viewBox='0 0 24 24'
fill='none'
stroke='currentColor'
strokeWidth='1.5'
strokeLinecap='round'
strokeLinejoin='round'
>
<path d='M12 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v5' />
<path d='M7 7h1' />
<path d='M11 7h1' />
<path d='M7 11h1' />
<path d='M7 15h1' />
<circle cx='17' cy='16' r='3' />
<path d='m21 20-1.9-1.9' />
</svg>
)
}
export function HuggingFaceIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
Expand Down
3 changes: 3 additions & 0 deletions apps/docs/components/ui/icon-mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ import {
OnePasswordIcon,
OpenAIIcon,
OracleIcon,
OrganizationSearchIcon,
OtterIcon,
OutlookIcon,
PackageSearchIcon,
Expand Down Expand Up @@ -652,6 +653,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
openai: OpenAIIcon,
oracle_fusion_financials: OracleIcon,
oracledb: OracleIcon,
organization: OrganizationSearchIcon,
otter: OtterIcon,
otter_v2: OtterIcon,
outlook: OutlookIcon,
Expand Down Expand Up @@ -885,6 +887,7 @@ export const coreBlockTypes = new Set([
'memory',
'mothership',
'note',
'organization',
'pi',
'response',
'router',
Expand Down
273 changes: 273 additions & 0 deletions apps/sim/blocks/blocks/organization.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@
import { OrganizationSearchIcon } from '@/components/icons'
import type { BlockConfig } from '@/blocks/types'
import {
blockFieldOrToolArg,
mapperOperation,
parseOptionalJsonInput,
parseOptionalNumberInput,
} from '@/blocks/utils'

/** Operations, keyed by the Search MCP tool they run; each runs the tool `organization_<id>`. */
const OPERATIONS = [
{ label: 'Search', id: 'search' },
{ label: 'Read Document', id: 'read_document' },
{ label: 'Search People', id: 'search_people' },
] as const

const OPERATION_IDS = new Set<string>(OPERATIONS.map((operation) => operation.id))

/** Organization Search: the Search MCP tools as one workflow block, run as the run's person. */
export const OrganizationBlock: BlockConfig = {
type: 'organization',
name: 'Organization Search',
description: 'Search your organization’s sources and people directory',
longDescription:
'Search the organization’s connected sources through their live APIs, read the documents they return, and look people up in the People directory. Every operation runs as the person who started the run, within their own access, so a scheduled or webhook run without a person fails instead of borrowing anyone’s access.',
bestPractices: `
- Use Search to find candidates, then Read Document with a returned documentId when the passage is not enough.
- Search People covers only this organization's people; use Search for customers, vendors, and other outside contacts.
- Runs started by a schedule, a webhook, or a workspace API key have no person to search as, and fail.
`,
bgColor: '#2563EB',
icon: OrganizationSearchIcon,
canvasPresentation: {
defaultTitle: 'Organization Search',
sentences: {
byOperation: {
search: [
'Search organization sources',
{ text: 'for', field: 'query' },
{ text: 'in', field: 'source' },
],
read_document: [{ text: 'Read', field: 'documentId', core: true }],
search_people: ['Find people', { text: 'matching', field: 'query' }],
},
},
},
category: 'blocks',
docsLink: 'https://docs.sim.ai/integrations/organization',
subBlocks: [
{
Comment thread
waleedlatif1 marked this conversation as resolved.
Resolved
id: 'operation',
title: 'Operation',
type: 'dropdown',
options: [...OPERATIONS],
value: () => 'search',
},
{
id: 'query',
title: 'Query',
type: 'long-input',
placeholder: 'What to look for',
condition: { field: 'operation', value: ['search', 'search_people'] },
},
{
id: 'source',
title: 'Source',
type: 'short-input',
placeholder: 'slack, jira, confluence, google_drive, gitlab…',
condition: { field: 'operation', value: 'search' },
mode: 'advanced',
},
{
id: 'startDate',
title: 'Start Date',
type: 'short-input',
placeholder: '2026-01-01T00:00:00-08:00 (inclusive)',
condition: { field: 'operation', value: 'search' },
mode: 'advanced',
},
{
id: 'endDate',
title: 'End Date',
type: 'short-input',
placeholder: '2026-02-01T00:00:00-08:00 (exclusive)',
condition: { field: 'operation', value: 'search' },
mode: 'advanced',
},
{
id: 'modifiedAfter',
title: 'Modified After',
type: 'short-input',
placeholder: '2026-01-01T00:00:00Z',
condition: { field: 'operation', value: 'search' },
mode: 'advanced',
},
{
id: 'modifiedBefore',
title: 'Modified Before',
type: 'short-input',
placeholder: '2026-02-01T00:00:00Z',
condition: { field: 'operation', value: 'search' },
mode: 'advanced',
},
{
id: 'searchDocumentIds',
title: 'Only Documents',
type: 'long-input',
placeholder: 'documentIds from an earlier search, one per line',
condition: { field: 'operation', value: 'search' },
mode: 'advanced',
},
{
id: 'sortBy',
title: 'Sort By',
type: 'dropdown',
options: [
{ label: 'Relevance', id: 'relevance' },
{ label: 'Newest', id: 'newest' },
{ label: 'Oldest', id: 'oldest' },
],
value: () => 'relevance',
condition: { field: 'operation', value: 'search' },
mode: 'advanced',
},
{
id: 'involving',
title: 'Involving',
type: 'short-input',
placeholder: '"me" or a colleague’s email',
condition: { field: 'operation', value: 'search' },
mode: 'advanced',
},
{
id: 'nativeQueries',
title: 'Native Queries',
type: 'code',
language: 'json',
placeholder:
'[{ "provider": "jira", "accountId": "…", "query": "project = ENG", "cursor": "…" }]',
condition: { field: 'operation', value: 'search' },
mode: 'advanced',
},
{
id: 'topK',
title: 'Max Results',
type: 'short-input',
placeholder: '20',
condition: { field: 'operation', value: 'search' },
mode: 'advanced',
},
{
id: 'documentId',
Comment thread
waleedlatif1 marked this conversation as resolved.
Resolved
title: 'Document',
type: 'short-input',
placeholder: 'A documentId from Search, or a link to the item',
condition: { field: 'operation', value: 'read_document' },
},
{
id: 'documentIds',
title: 'Documents',
type: 'long-input',
placeholder: 'Up to 10 documentIds or links, one per line, read together instead of Document',
condition: { field: 'operation', value: 'read_document' },
mode: 'advanced',
},
{
id: 'startChunkIndex',
title: 'Start Chunk Index',
type: 'short-input',
placeholder: 'next.startChunkIndex from a previous read',
condition: { field: 'operation', value: 'read_document' },
mode: 'advanced',
},
{
id: 'startOffset',
title: 'Start Offset',
type: 'short-input',
placeholder: 'next.startOffset from a previous read',
condition: { field: 'operation', value: 'read_document' },
mode: 'advanced',
},
{
id: 'personId',
title: 'Person ID',
type: 'short-input',
placeholder: 'A personId from an earlier result',
condition: { field: 'operation', value: 'search_people' },
mode: 'advanced',
},
{
id: 'cursor',
title: 'Cursor',
type: 'short-input',
placeholder: 'nextCursor from the previous page',
condition: { field: 'operation', value: 'search_people' },
mode: 'advanced',
},
],
tools: {
access: OPERATIONS.map((operation) => `organization_${operation.id}`),
config: {
tool: (params) => `organization_${params.operation || 'search'}`,
params: (params, context) => {
const operation = mapperOperation(params, context) || 'search'
if (!OPERATION_IDS.has(operation))
throw new Error(`Unsupported Organization Search operation: ${operation}`)
if (operation === 'read_document' && !params.documentId === !params.documentIds)
throw new Error('Read Document needs either a Document or a list of Documents')
return {
...params,
Comment thread
waleedlatif1 marked this conversation as resolved.
Resolved
...(operation === 'search'
? {
documentIds: blockFieldOrToolArg(
Comment thread
waleedlatif1 marked this conversation as resolved.
Resolved
context,
params.searchDocumentIds,
params.documentIds
),
}
: {}),
topK: parseOptionalNumberInput(params.topK, 'Max Results'),
nativeQueries: parseOptionalJsonInput(params.nativeQueries, 'Native Queries'),
startChunkIndex: parseOptionalNumberInput(params.startChunkIndex, 'Start Chunk Index'),
startOffset: parseOptionalNumberInput(params.startOffset, 'Start Offset'),
}
},
},
},
inputs: {
operation: { type: 'string', description: 'Operation to perform' },
query: { type: 'string', description: 'Search terms, or words from a person’s profile' },
source: { type: 'string', description: 'Only this source' },
startDate: { type: 'string', description: 'Inclusive lower date bound (ISO datetime)' },
endDate: { type: 'string', description: 'Exclusive upper date bound (ISO datetime)' },
sortBy: { type: 'string', description: 'relevance, newest, or oldest' },
involving: { type: 'string', description: '"me" or a colleague’s email' },
nativeQueries: {
type: 'json',
description: 'Provider-language queries and continuation cursors',
},
topK: { type: 'number', description: 'Maximum results' },
modifiedAfter: { type: 'string', description: 'Only documents modified after (ISO datetime)' },
modifiedBefore: {
type: 'string',
description: 'Only documents modified before (ISO datetime)',
},
searchDocumentIds: { type: 'string', description: 'Search only these documentIds' },
documentId: { type: 'string', description: 'Document to read' },
documentIds: { type: 'string', description: 'Documents to read together' },
startChunkIndex: { type: 'number', description: 'Chunk to continue reading from' },
startOffset: { type: 'number', description: 'Where to continue reading' },
personId: { type: 'string', description: 'Person to show with their reporting line' },
cursor: { type: 'string', description: 'Next page of a people search' },
},
outputs: {
results: { type: 'array', description: 'Search: matching documents with passages' },
retrieval: { type: 'json', description: 'Search: whether retrieval was complete' },
live: { type: 'json', description: 'Search: per-account status and cursors' },
documentId: { type: 'string', description: 'Read Document: the document read' },
title: { type: 'string', description: 'Read Document: document title' },
citationUrl: { type: 'string', description: 'Read Document: link to the document' },
chunks: { type: 'array', description: 'Read Document: the text read' },
hasMore: { type: 'boolean', description: 'Read Document: whether more remains' },
next: { type: 'json', description: 'Read Document: where to continue' },
documents: {
type: 'array',
description: 'Read Document: each document of a multi-document read, or its error',
},
people: { type: 'array', description: 'Search People: matching people' },
person: { type: 'json', description: 'Search People: the one matching person' },
nextCursor: { type: 'string', description: 'Search People: cursor for the next page' },
note: { type: 'string', description: 'Search People: guidance when no one matches' },
},
}
2 changes: 2 additions & 0 deletions apps/sim/blocks/registry-maps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ import {
OracleFusionFinancialsBlockMeta,
} from '@/blocks/blocks/oracle_fusion_financials'
import { OracleDatabaseBlock, OracleDatabaseBlockMeta } from '@/blocks/blocks/oracledb'
import { OrganizationBlock } from '@/blocks/blocks/organization'
import { OtterBlock, OtterBlockMeta, OtterV2Block } from '@/blocks/blocks/otter'
import { OutlookBlock, OutlookBlockMeta } from '@/blocks/blocks/outlook'
import { PagerDutyBlock, PagerDutyBlockMeta, PagerDutyV2Block } from '@/blocks/blocks/pagerduty'
Expand Down Expand Up @@ -807,6 +808,7 @@ export const BLOCK_REGISTRY: Record<string, BlockConfig> = {
openai: OpenAIBlock,
oracle_fusion_financials: OracleFusionFinancialsBlock,
oracledb: OracleDatabaseBlock,
organization: OrganizationBlock,
otter: OtterBlock,
otter_v2: OtterV2Block,
outlook: OutlookBlock,
Expand Down
1 change: 1 addition & 0 deletions apps/sim/blocks/sdk-names.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ const BLOCKS: Record<string, string> = {
openai: '{"namespace":"legacy.openai"}',
oracle_fusion_financials: '{"namespace":"oracleFusionFinancials","methods":{"oracle_fusion_financials_apply_receivables_receipt":"applyReceivablesReceipt","oracle_fusion_financials_approve_receivables_invoice":"approveReceivablesInvoice","oracle_fusion_financials_create_expense_line":"createExpenseLine","oracle_fusion_financials_create_expense_report":"createExpenseReport","oracle_fusion_financials_create_receivables_credit_memo":"createReceivablesCreditMemo","oracle_fusion_financials_create_receivables_invoice":"createReceivablesInvoice","oracle_fusion_financials_create_receivables_receipt":"createReceivablesReceipt","oracle_fusion_financials_get_expense_line":"getExpenseLine","oracle_fusion_financials_get_expense_report":"getExpenseReport","oracle_fusion_financials_get_gl_journal_batch":"getGlJournalBatch","oracle_fusion_financials_get_gl_ledger":"getGlLedger","oracle_fusion_financials_get_payables_invoice":"getPayablesInvoice","oracle_fusion_financials_get_payables_invoice_line":"getPayablesInvoiceLine","oracle_fusion_financials_get_payables_payment":"getPayablesPayment","oracle_fusion_financials_get_receivables_credit_memo":"getReceivablesCreditMemo","oracle_fusion_financials_get_receivables_invoice":"getReceivablesInvoice","oracle_fusion_financials_get_receivables_invoice_installment":"getReceivablesInvoiceInstallment","oracle_fusion_financials_get_receivables_invoice_line":"getReceivablesInvoiceLine","oracle_fusion_financials_get_receivables_receipt":"getReceivablesReceipt","oracle_fusion_financials_list_expense_lines":"listExpenseLines","oracle_fusion_financials_list_expense_reports":"listExpenseReports","oracle_fusion_financials_list_gl_balances":"listGlBalances","oracle_fusion_financials_list_gl_journal_batches":"listGlJournalBatches","oracle_fusion_financials_list_gl_ledgers":"listGlLedgers","oracle_fusion_financials_list_payables_invoice_lines":"listPayablesInvoiceLines","oracle_fusion_financials_list_payables_invoices":"listPayablesInvoices","oracle_fusion_financials_list_payables_payments":"listPayablesPayments","oracle_fusion_financials_list_receivables_credit_memos":"listReceivablesCreditMemos","oracle_fusion_financials_list_receivables_invoice_installments":"listReceivablesInvoiceInstallments","oracle_fusion_financials_list_receivables_invoice_lines":"listReceivablesInvoiceLines","oracle_fusion_financials_list_receivables_invoices":"listReceivablesInvoices","oracle_fusion_financials_list_receivables_receipts":"listReceivablesReceipts","oracle_fusion_financials_submit_expense_report":"submitExpenseReport","oracle_fusion_financials_update_expense_line":"updateExpenseLine","oracle_fusion_financials_update_expense_report":"updateExpenseReport","oracle_fusion_financials_update_receivables_invoice":"updateReceivablesInvoice"},"paramAliases":{"action":{"oauthCredential":"credential"}}}',
oracledb: '{"namespace":"oracledb","methods":{"delete":"deleteData","execute":"executeSql","insert":"insertData","introspect":"introspectSchema","query":"querySelect","update":"updateData"},"paramAliases":{"action":{"oauthCredential":"credential"}}}',
organization: '{"namespace":"organization","methods":{"read_document":"readDocument","search":"search","search_people":"searchPeople"}}',
otter: '{"namespace":"legacy.otter","methods":{"create_conversation":"importRecording","get_conversation":"getConversation","get_conversation_audio":"getConversationAudio","get_workspace":"getWorkspace","list_channel_members":"listChannelMembers","list_channels":"listChannels","list_conversations":"listConversations","list_workspace_conversations":"listWorkspaceConversations"},"triggers":{"otter_conversation_completed":"conversationCompleted","otter_conversation_shared":"conversationShared","otter_webhook":"webhook"}}',
otter_v2: '{"namespace":"otter","methods":{"create_conversation":"importRecording","get_conversation":"getConversation","get_conversation_audio":"getConversationAudio","get_workspace":"getWorkspace","list_channel_members":"listChannelMembers","list_channels":"listChannels","list_conversations":"listConversations","list_workspace_conversations":"listWorkspaceConversations"},"triggers":{"otter_conversation_completed":"conversationCompleted","otter_conversation_shared":"conversationShared","otter_webhook":"webhook"},"paramAliases":{"action":{"oauthCredential":"credential"}}}',
outlook: '{"namespace":"outlook","methods":{"copy_outlook":"copyEmail","create_event_calendar":"createEvent","create_folder_outlook":"createFolder","delete_event_calendar":"deleteEvent","delete_outlook":"deleteEmail","draft_outlook":"draftEmail","forward_outlook":"forwardEmail","get_attachment_outlook":"getAttachment","get_event_calendar":"getCalendarEvent","list_attachments_outlook":"listAttachments","list_events_calendar":"listCalendarEvents","list_folders_outlook":"listFolders","mark_read_outlook":"markAsRead","mark_unread_outlook":"markAsUnread","move_outlook":"moveEmail","read_outlook":"readEmail","reply_all_outlook":"replyAll","reply_outlook":"replyToEmail","respond_calendar":"respondToInvite","search_outlook":"searchEmail","send_outlook":"sendEmail","update_event_calendar":"updateEvent","update_message_outlook":"setCategoriesFlag"},"triggers":{"outlook_poller":"poller"},"paramAliases":{"action":{"oauthCredential":"credential"},"trigger":{"oauthCredential":"credential"}}}',
Expand Down
8 changes: 8 additions & 0 deletions apps/sim/blocks/sdk-names/organization.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"namespace": "organization",
"methods": {
"read_document": "readDocument",
"search": "search",
"search_people": "searchPeople"
}
}
24 changes: 24 additions & 0 deletions apps/sim/components/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4258,6 +4258,30 @@ export function PackageSearchIcon(props: SVGProps<SVGSVGElement>) {
</svg>
)
}
export function OrganizationSearchIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
{...props}
xmlns='http://www.w3.org/2000/svg'
width='24'
height='24'
viewBox='0 0 24 24'
fill='none'
stroke='currentColor'
strokeWidth='1.5'
strokeLinecap='round'
strokeLinejoin='round'
>
<path d='M12 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v5' />
<path d='M7 7h1' />
<path d='M11 7h1' />
<path d='M7 11h1' />
<path d='M7 15h1' />
<circle cx='17' cy='16' r='3' />
<path d='m21 20-1.9-1.9' />
</svg>
)
}
export function HuggingFaceIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
Expand Down
Loading
Loading