Workflow Activities

This page lists the public workflow activities that are available in the platform.

Create Document Type From Interaction Run
createDocumentTypeFromInteractionRun
Parameters
CreateDocumentTypeFromInteractionRunParams
run
ExecutionRun
The execution run object to use. Required. Not required in params since it is usually fetched
updateObjectId
optionalstring
If defined then update the object type with the created type
Returns
void
Create Or Update Document From Interaction Run
createOrUpdateDocumentFromInteractionRun
Parameters
CreateOrUpdateObjectFromInteractionRunParams
run_id
optionalstring
The execution run object to use. Required. Not required in params since it is usually fetched
object_type
optionalstring
The document type to use. Required if update_existing_id is false. Not required in params since it is usually fetched
update_existing_id
optionalstring
The id of the document to update. If not provided, a new document will be created
fallback_name
optionalstring
The name of the object to use. If not provided, the name will be generated from the interaction result
parent
optionalstring
The name of the parent object to use. If not provided, the document will be created at the root level
update_text_from_property
optionalstring
The name of the property to use for the text. If not provided, the text will be set to the result of the interaction
Returns
void
Update Document From Interaction Run
updateDocumentFromInteractionRun
Parameters
UpdateDocumentFromInteractionRunParams
run
optionalExecutionRun
The execution run object to use. Required. Not required in params since it is usually fetched
Returns
void
Chunk Document
chunkDocument
Parameters
ChunkDocumentParams
force
optionalboolean
If true, force chunking even if the document is already chunked
interactionName
optionalstring
The interaction name to use for chunking If not set, the default interaction will be used
docPartType
optionalstring
The object type to use for the document parts If not set, the type of the document will be used
createParts
optionalboolean
If true, create parts as document objects
Returns
Promise<ChunkDocumentResult>
Create Pdf Document From Source
createPdfDocumentFromSource
Create a new PDF by extrracting pages from a source PDF @returns
Parameters
CreatePdfDocumentFromSourceParams
target_object_type
string
title
string
filename
optionalstring
pages
number[]
parent
optionalstring
Returns
void
Execute Interaction
executeInteraction
Parameters
ExecuteInteractionParams
interactionName
string
prompt_data
Record<string, any>
static_prompt_data
optionalRecord<string, any>
Additional prompt data passed by the workflow configuration. This will be merged with prompt_data if any. You should use `import: ["static_prompt_data"]` to import the workflow prompt data as static_prompt_data param. Otherwise the workflow prompt data will be ignored.
truncate
optionalRecord<string, number | inline object>
Returns
void
Extract Document Text
extractDocumentText
Parameters
ExtractDocumentTextParams
Returns
Promise<TextExtractionResult>
Generate Document Properties
generateDocumentProperties
Parameters
GenerateDocumentPropertiesParams
typesHint
optionalstring[]
truncate
optionalnumber | inline object
truncate the input doc text to the specified max_tokens
interactionName
optionalstring
use_vision
optionalboolean
Returns
void
Generate Embeddings
generateEmbeddings
Parameters
GenerateEmbeddingsParams
model
optionalstring
The model to use for embedding generation If not set, the default model for the project will be used
environment
optionalstring
The environment to use for embedding generation If not set, the default environment for the project will be used
force
optionalboolean
If true, force embedding generation even if the document already has embeddings
type
SupportedEmbeddingTypes
The embedding type to generate
textimageproperties
parts
optionalDocPart[]
The DocParts to use for long documents
Returns
void
Generate Image Rendition
generateImageRendition
Parameters
GenerateImageRenditionParams
max_hw
number
format
string
Returns
void
Generate Or Assign Content Type
generateOrAssignContentType
Parameters
GenerateOrAssignContentTypeParams
typesHint
optionalstring[]
truncate
optionalnumber | inline object
truncate the input doc text to the specified max_tokens
interactionNames
optionalinline object
The name of the interaction to execute @default SelectDocumentType
Returns
void
Get Object From Store
getObjectFromStore
We are using a union type for the status parameter since typescript enumbs breaks the workflow code generation @param objectId @param status
Parameters
GetObjectParams
select
optionalstring
Returns
Promise<ContentObject>
Convert Pdf To Structured Text
convertPdfToStructuredText
Parameters
ConvertPdfToStructuredTextParams
force
optionalboolean
Returns
Promise<StructuredTextResult>
Transcribe Media
transcribeMedia
Parameters
TranscriptMediaParams
environmentId
optionalstring
force
optionalboolean
Returns
Promise<TranscriptMediaResult>
Notify Webhook
notifyWebhook
Parameters
NotifyWebhookParams
target_url
string
method
GET | POST
payload
Record<string, any>
headers
optionalRecord<string, string>
Returns
void
Set Document Status
setDocumentStatus
We are using a union type for the status parameter since typescript enumbs breaks the workflow code generation @param objectId @param status
Parameters
SetDocumentStatusParams
status
ContentObjectStatus
createdprocessingcompletedfailedarchived
Returns
void
Analyse Page Layout
analysePageLayout
Parameters
AnalyzePageLayoutParams
page_number
number
expected_zones
optionalstring[]
debug
optionalboolean
page_as_image
optionalboolean
ocr
optionalboolean
interaction_name
optionalstring
table_types
optionalstring[]
Returns
Promise<AnalyzeLayoutActivityResult>
Analyse Page With Interaction
analysePageWithInteraction
Parameters
AnalyzePageParams
page_number
number
interaction_name
string
complexity_level
optionalPageComplexityLevel
lowmediumhigh
reconstruct_lines
optionalboolean
upload_result
optionalboolean
page_as_image
optionalboolean
prompt_data
optionalP
Returns
Promise<AnalyzePageWithInteractionResult<R>>
Assemble Document
assembleDocument
Parameters
AssembleDocumentParams
layouts
AnalyzeLayoutActivityResult[]
tables
AnalyzePageWithInteractionResult[]
images
AnalyzePageWithInteractionResult[]
visuals
AnalyzePageWithInteractionResult[]
table_format
efficient | normal
debug
optionalboolean
Returns
Promise<AssembledDocument>
Count Pages
countPages
Parameters
CountPagesParams
update_metadata
optionalboolean
Returns
Promise<CountPagesResult>
Store Pages As Images And Json
storePagesAsImagesAndJson
Parameters
StorePageAsImagesParams
page_numbers
optionalnumber[]
Returns
Promise<any>
Perform Ocr
performOcr
Parameters
PerformOcrParams
page_number
number
language
optionalstring
Returns
Promise<any>
Get Table Mappings
getTableMappings
Parameters
GetTableMappingsParams
item_name
string
target_schema
string
instructions
optionalstring
models
optionalMagicModel[]
page_numbers
optionalnumber[]
table_ids
optionalnumber[]
process_as_csv
optionalboolean
Returns
Promise<{ run_id: string; model: string; environment: string; mapping: string } | null>
Get Tables Ids
getTablesIds
Parameters
GetTablesIdsParams
update_metadata
optionalboolean
item_name
string
instructions
optionalstring
models
optionalMagicModel[]
Returns
Promise<TableInfo[]>
Process Tables
processTables
Parameters
ProcessTablesParams
run_ids
string[]
Returns
Promise<ProcessTablesResult>
Post Update Message
postUpdateMessage
Parameters
UpdateMessageParams
type
AgentMessageType
systemthoughtplanupdatecompletewarningerroranswerquestionrequest_inputidle
message
string
details
optionalany
Returns
void
Create Checkpoint
createCheckpoint
Parameters
CreateCheckpointParams
tools
ToolDefinition[]
Returns
Promise<ConversationState>
Resume Conversation
resumeConversation
Parameters
ResumeConversationParams
results
inline object[]
tools
ToolDefinition[]
user_message
optionalstring
Returns
Promise<ConversationState>
Start Conversation
startConversation
Parameters
StartConversationParams
payload
AsyncConversationExecutionPayload
tools
ToolDefinition[]
Returns
Promise<ConversationState>
Generate Tools
generateTools
Generate dynamic tools as interaction tools and dynamic descriptions @param payload
Parameters
GenerateToolsParams
generate_interaction_tools
boolean
include_interactions
optionalstring[]
Optionally filter by interaction endpoint name to includes only the specified interactions
exclude_interactions
optionalstring[]
Optionally filter by interaction endpoint name to excludes the specified interactions If both includes and excludes are provided the includes will be done first.
Returns
Promise<GenerateToolsResult>
Fetch Documents Activity
fetchDocumentsActivity
Parameters
FetchDocumentsActivityParams
input
FetchDocumentsToolParams
Returns
Promise<ToolResponseType>
Search Documents Activity
searchDocumentsActivity
Parameters
SearchDocumentAcitivityParams
input
SearchDocumentsToolParams
Returns
Promise<ToolResponseType>
Create Document Activity
createDocumentActivity
Parameters
CreateDocumentActivityParams
input
CreateDocumentToolParams
Returns
Promise<ToolResponseType>
Web Search Activity
webSearchActivity
Parameters
WebSearchActivityParams
input
WebSearchToolParams
Returns
Promise<ToolResponseType>

Was this page helpful?