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
ExecutionRunThe execution run object to use. Required.
Not required in params since it is usually fetched
updateObjectId
optionalstringIf defined then update the object type with the created type
Returns
void
Create Or Update Document From Interaction Run
createOrUpdateDocumentFromInteractionRun
Parameters
CreateOrUpdateObjectFromInteractionRunParams
run_id
optionalstringThe execution run object to use. Required.
Not required in params since it is usually fetched
object_type
optionalstringThe document type to use. Required if update_existing_id is false.
Not required in params since it is usually fetched
update_existing_id
optionalstringThe id of the document to update. If not provided, a new document will be created
fallback_name
optionalstringThe name of the object to use. If not provided, the name will be generated from the interaction result
parent
optionalstringThe name of the parent object to use. If not provided, the document will be created at the root level
update_text_from_property
optionalstringThe 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
optionalExecutionRunThe execution run object to use. Required.
Not required in params since it is usually fetched
Returns
void
Chunk Document
chunkDocument
Parameters
ChunkDocumentParams
force
optionalbooleanIf true, force chunking even if the document is already chunked
interactionName
optionalstringThe interaction name to use for chunking
If not set, the default interaction will be used
docPartType
optionalstringThe object type to use for the document parts
If not set, the type of the document will be used
createParts
optionalbooleanIf 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
stringtitle
stringfilename
optionalstringpages
number[]parent
optionalstringReturns
void
Execute Interaction
executeInteraction
Parameters
ExecuteInteractionParams
interactionName
stringprompt_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 objecttruncate the input doc text to the specified max_tokens
interactionName
optionalstringuse_vision
optionalbooleanReturns
void
Generate Embeddings
generateEmbeddings
Parameters
GenerateEmbeddingsParams
model
optionalstringThe model to use for embedding generation
If not set, the default model for the project will be used
environment
optionalstringThe environment to use for embedding generation
If not set, the default environment for the project will be used
force
optionalbooleanIf true, force embedding generation even if the document already has embeddings
type
SupportedEmbeddingTypesThe embedding type to generate
textimageproperties
parts
optionalDocPart[]The DocParts to use for long documents
Returns
void
Generate Image Rendition
generateImageRendition
Parameters
GenerateImageRenditionParams
max_hw
numberformat
stringReturns
void
Generate Or Assign Content Type
generateOrAssignContentType
Parameters
GenerateOrAssignContentTypeParams
typesHint
optionalstring[]truncate
optionalnumber | inline objecttruncate the input doc text to the specified max_tokens
interactionNames
optionalinline objectThe 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
optionalstringReturns
Promise<ContentObject>
Convert Pdf To Structured Text
convertPdfToStructuredText
Parameters
ConvertPdfToStructuredTextParams
force
optionalbooleanReturns
Promise<StructuredTextResult>
Transcribe Media
transcribeMedia
Parameters
TranscriptMediaParams
environmentId
optionalstringforce
optionalbooleanReturns
Promise<TranscriptMediaResult>
Notify Webhook
notifyWebhook
Parameters
NotifyWebhookParams
target_url
stringmethod
GET | POSTpayload
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
ContentObjectStatuscreatedprocessingcompletedfailedarchived
Returns
void
Analyse Page Layout
analysePageLayout
Parameters
AnalyzePageLayoutParams
page_number
numberexpected_zones
optionalstring[]debug
optionalbooleanpage_as_image
optionalbooleanocr
optionalbooleaninteraction_name
optionalstringtable_types
optionalstring[]Returns
Promise<AnalyzeLayoutActivityResult>
Analyse Page With Interaction
analysePageWithInteraction
Parameters
AnalyzePageParams
page_number
numberinteraction_name
stringcomplexity_level
optionalPageComplexityLevellowmediumhigh
reconstruct_lines
optionalbooleanupload_result
optionalbooleanpage_as_image
optionalbooleanprompt_data
optionalPReturns
Promise<AnalyzePageWithInteractionResult<R>>
Assemble Document
assembleDocument
Parameters
AssembleDocumentParams
layouts
AnalyzeLayoutActivityResult[]tables
AnalyzePageWithInteractionResult[]images
AnalyzePageWithInteractionResult[]visuals
AnalyzePageWithInteractionResult[]table_format
efficient | normaldebug
optionalbooleanReturns
Promise<AssembledDocument>
Count Pages
countPages
Parameters
CountPagesParams
update_metadata
optionalbooleanReturns
Promise<CountPagesResult>
Store Pages As Images And Json
storePagesAsImagesAndJson
Parameters
StorePageAsImagesParams
page_numbers
optionalnumber[]Returns
Promise<any>
Perform Ocr
performOcr
Parameters
PerformOcrParams
page_number
numberlanguage
optionalstringReturns
Promise<any>
Get Table Mappings
getTableMappings
Parameters
GetTableMappingsParams
item_name
stringtarget_schema
stringinstructions
optionalstringmodels
optionalMagicModel[]page_numbers
optionalnumber[]table_ids
optionalnumber[]process_as_csv
optionalbooleanReturns
Promise<{ run_id: string; model: string; environment: string; mapping: string } | null>
Get Tables Ids
getTablesIds
Parameters
GetTablesIdsParams
update_metadata
optionalbooleanitem_name
stringinstructions
optionalstringmodels
optionalMagicModel[]Returns
Promise<TableInfo[]>
Process Tables
processTables
Parameters
ProcessTablesParams
run_ids
string[]Returns
Promise<ProcessTablesResult>
Post Update Message
postUpdateMessage
Parameters
UpdateMessageParams
type
AgentMessageTypesystemthoughtplanupdatecompletewarningerroranswerquestionrequest_inputidle
message
stringdetails
optionalanyReturns
void
Create Checkpoint
createCheckpoint
Parameters
CreateCheckpointParams
tools
ToolDefinition[]Returns
Promise<ConversationState>
Resume Conversation
resumeConversation
Parameters
ResumeConversationParams
results
inline object[]tools
ToolDefinition[]user_message
optionalstringReturns
Promise<ConversationState>
Start Conversation
startConversation
Parameters
StartConversationParams
payload
AsyncConversationExecutionPayloadtools
ToolDefinition[]Returns
Promise<ConversationState>
Generate Tools
generateTools
Generate dynamic tools as interaction tools and dynamic descriptions
@param payload
Parameters
GenerateToolsParams
generate_interaction_tools
booleaninclude_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
FetchDocumentsToolParamsReturns
Promise<ToolResponseType>
Search Documents Activity
searchDocumentsActivity
Parameters
SearchDocumentAcitivityParams
input
SearchDocumentsToolParamsReturns
Promise<ToolResponseType>
Create Document Activity
createDocumentActivity
Parameters
CreateDocumentActivityParams
input
CreateDocumentToolParamsReturns
Promise<ToolResponseType>
Web Search Activity
webSearchActivity
Parameters
WebSearchActivityParams
input
WebSearchToolParamsReturns
Promise<ToolResponseType>