Calling an Action or Foundry Function from Pipeline Builder

Hi all,

I needed to call a typescript foundry function from streaming pipeline in pipeline builder, which isn’t a core feature at the moment, so I wanted to share my temporary workaround and see if anyone else has done anything similar. My setup is as follows:

  1. Created my typescript foundry function in Code Repos
  2. Created a foundry action, which called my typescript foundry function
  3. Created a python UDF, which used foundry API to call my action
  4. In pipeline builder, created a streaming pipeline, and used the stream fields as input for my python UDF, which called my foundry action, which then triggers my typescript foundry function

For implementing step 3, here are some docs I found useful:
Get Action Type docs (to get the format of the payload to be used): https://www.palantir.com/docs/foundry/api/v1/ontology-resources/action-types/get-action-type/
Apply Action (to actually run the action): https://www.palantir.com/docs/foundry/api/v1/ontology-resources/actions/apply-action/

3 Likes

I wanted to give an update here: I ended up switching my approach to use a compute module instead, running it in pipeline execution mode, which was much cleaner than my original workaround: https://www.palantir.com/docs/foundry/compute-modules/execution-modes#pipeline-execution-mode

To run my functions (called by actions), I created a new OSDK backend service and added my object types and action types to it. I exported it as a python package, which I then imported into my compute module, following the “Use the Ontology SDK in a compute module” guide in the Documentation tab of the compute module.