POST
/
pipelines
from mixpeek import Mixpeek

mixpeek = Mixpeek("API_KEY")


pipeline_id = mixpeek.pipelines.create(
  alias="MyPipeline",
  code="function execute() { return true; }",
  source={
    "connection_id": "conn_456",
    "filters": {
      "foo": "bar"
    }
  },
  destination={
    "connection_id": "conn_431",
    "collection": "data_bucket",
    "metadata": {
      "type": "storage"
    }
  }
)
{
  "pipeline_id": "<string>",
  "enabled": true,
  "connections": {},
  "metadata": {}
}

Pipelines are the backbone of Mixpeek. It’s where you describe how you want the engine to process your objects as they pass through in real-time.

To build a pipeline, you’ll need to first have created a source and destination connection, then add their connection_id in the connections object.

Request

alias
string

Alias for the execution function

code
string

The JavaScript code to execute

source.connection_id
string

Source connection ID

source.filters.foo
string

Filter key “foo” value

destination.connection_id
string

Destination connection ID

destination.collection
string

Destination collection name

destination.metadata.type
string

Metadata type

transformation_code
string
required

The code, provided as a string, which dictates how the data will be transformed during the pipeline process.

metadata
object

Optional metadata to provide context or additional information about the pipeline being created.

Response

pipeline_id
string
required

The unique identifier for the newly created pipeline. This ID can be used to reference the pipeline in future operations.

enabled
boolean

Indicates whether the pipeline is enabled upon creation. This can be set to true to start processing immediately.

connections
object
required

Echoes back the source and destination connection IDs provided in the request, confirming the data flow paths that have been set up.

metadata
object

Echoes back any metadata provided in the request, confirming the additional contextual information associated with the pipeline.

from mixpeek import Mixpeek

mixpeek = Mixpeek("API_KEY")


pipeline_id = mixpeek.pipelines.create(
  alias="MyPipeline",
  code="function execute() { return true; }",
  source={
    "connection_id": "conn_456",
    "filters": {
      "foo": "bar"
    }
  },
  destination={
    "connection_id": "conn_431",
    "collection": "data_bucket",
    "metadata": {
      "type": "storage"
    }
  }
)