← Lemon Squeezy + Ollama integrations

Create Model with Ollama API on New Subscription Cancelled from Lemon Squeezy API

Pipedream makes it easy to connect APIs for Ollama, Lemon Squeezy and 2,500+ other apps remarkably fast.

Trigger workflow on
New Subscription Cancelled from the Lemon Squeezy API
Next, do this
Create Model with the Ollama API
No credit card required
Intro to Pipedream
Watch us build a workflow
Watch us build a workflow
8 min
Watch now ➜

Trusted by 1,000,000+ developers from startups to Fortune 500 companies

Adyen logo
Appcues logo
Bandwidth logo
Checkr logo
ChartMogul logo
Dataminr logo
Gopuff logo
Gorgias logo
LinkedIn logo
Logitech logo
Replicated logo
Rudderstack logo
SAS logo
Scale AI logo
Webflow logo
Warner Bros. logo
Adyen logo
Appcues logo
Bandwidth logo
Checkr logo
ChartMogul logo
Dataminr logo
Gopuff logo
Gorgias logo
LinkedIn logo
Logitech logo
Replicated logo
Rudderstack logo
SAS logo
Scale AI logo
Webflow logo
Warner Bros. logo

Developers Pipedream

Getting Started

This integration creates a workflow with a Lemon Squeezy trigger and Ollama action. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Select this integration
  2. Configure the New Subscription Cancelled trigger
    1. Connect your Lemon Squeezy account
    2. Configure timer
  3. Configure the Create Model action
    1. Connect your Ollama account
    2. Configure Name
    3. Configure Model File
    4. Optional- Configure Stream
  4. Deploy the workflow
  5. Send a test event to validate your setup
  6. Turn on the trigger

Details

This integration uses pre-built, source-available components from Pipedream's GitHub repo. These components are developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

Trigger

Description:Emit new event when a new subscription is cancelled.
Version:0.0.1
Key:lemon_squeezy-subscription-cancelled

Lemon Squeezy Overview

The Lemon Squeezy API lets you manage and sell digital products with ease. On Pipedream, you can integrate Lemon Squeezy with your sales, marketing, and support tools to automate tasks like customer follow-ups, license management, and sales reporting. With Pipedream's serverless platform, you can create workflows that trigger on Lemon Squeezy events or schedule tasks, process data, and connect to a vast array of other apps and services without writing backend infrastructure.

Trigger Code

import { defineSource } from "@pipedream/types";
import moment from "moment";
import common from "../common/base.mjs";
export default defineSource({
    ...common,
    key: "lemon_squeezy-subscription-cancelled",
    name: "New Subscription Cancelled",
    description: "Emit new event when a new subscription is cancelled.",
    version: "0.0.1",
    type: "source",
    dedupe: "unique",
    methods: {
        ...common.methods,
        setLastEnd(lastEnd) {
            this.db.set("lastEnd", lastEnd);
        },
        getLastEnd() {
            return this.db.get("lastEnd") || 0;
        },
        async startEvent(maxResults) {
            const lastEnd = this.getLastEnd();
            const responseArray = [];
            let tempLastEnd = lastEnd;
            const items = this.lemonSqueezy.paginate({
                fn: this.lemonSqueezy.listSubscriptions,
                params: {
                    sort: "-endsAt",
                },
                maxResults,
            });
            for await (const item of items) {
                const newLastEnd = item.attributes.ends_at;
                if (item.attributes.ends_at
                    && moment(newLastEnd).isAfter(lastEnd)
                    && item.attributes.cancelled) {
                    responseArray.push(item);
                    if (moment(newLastEnd).isAfter(tempLastEnd)) {
                        tempLastEnd = newLastEnd;
                    }
                }
                else {
                    break;
                }
            }
            if (!moment(lastEnd).isSame(tempLastEnd))
                this.setLastEnd(tempLastEnd);
            for (const responseItem of responseArray.reverse()) {
                this.$emit(responseItem, {
                    id: responseItem.id,
                    summary: `A new subscription with id ${responseItem.id} was cancelled!`,
                    ts: responseItem.createdAt,
                });
            }
        },
    },
});

Trigger Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
Lemon SqueezylemonSqueezyappThis component uses the Lemon Squeezy app.
timer$.interface.timer
N/Adb$.service.dbThis component uses $.service.db to maintain state between executions.

Trigger Authentication

Lemon Squeezy uses API keys for authentication. When you connect your Lemon Squeezy account, Pipedream securely stores the keys so you can easily authenticate to Lemon Squeezy APIs in both code and no-code steps.

To connect Pipedream with your Lemon Squeezy account,

  • Sign in to your Lemon Squeezy account
  • Create a new API key here
  • Paste that below

About Lemon Squeezy

Lemon Squeezy is the all-in-one platform for running your SaaS business. Payments, subscriptions, global tax compliance, fraud prevention, multi-currency support, failed payment recovery, PayPal integration and more. We make running your software business easy peasy.

Action

Description:Create a model from a modelfile. [See the documentation](https://github.com/ollama/ollama/blob/main/docs/api.md#create-a-model).
Version:0.0.1
Key:ollama-create-model

Action Code

import app from "../../ollama.app.mjs";

export default {
  key: "ollama-create-model",
  name: "Create Model",
  description: "Create a model from a modelfile. [See the documentation](https://github.com/ollama/ollama/blob/main/docs/api.md#create-a-model).",
  version: "0.0.1",
  type: "action",
  props: {
    app,
    name: {
      type: "string",
      label: "Name",
      description: "The name of the model.",
    },
    modelfile: {
      type: "string",
      label: "Model File",
      description: "Contents of the Modelfile. Eg. `FROM llama3 SYSTEM You are mario from Super Mario Bros`",
    },
    stream: {
      propDefinition: [
        app,
        "stream",
      ],
    },
  },
  methods: {
    createModel(args = {}) {
      return this.app.post({
        path: "/create",
        ...args,
      });
    },
  },
  async run({ $ }) {
    const {
      createModel,
      name,
      modelfile,
      stream,
    } = this;

    const response = await createModel({
      $,
      data: {
        name,
        modelfile,
        stream,
      },
    });
    $.export("$summary", "Successfully created model.");
    return response;
  },
};

Action Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI.

LabelPropTypeDescription
OllamaappappThis component uses the Ollama app.
Namenamestring

The name of the model.

Model Filemodelfilestring

Contents of the Modelfile. Eg. FROM llama3 SYSTEM You are mario from Super Mario Bros

Streamstreamboolean

If false the response will be returned as a single response object, rather than a stream of objects.

Action Authentication

Ollama uses API keys for authentication. When you connect your Ollama account, Pipedream securely stores the keys so you can easily authenticate to Ollama APIs in both code and no-code steps.

About Ollama

Get up and running with large language models.

More Ways to Connect Ollama + Lemon Squeezy

Copy Model with Ollama API on New Order Created from Lemon Squeezy API
Lemon Squeezy + Ollama
 
Try it
Copy Model with Ollama API on New Subscription Cancelled from Lemon Squeezy API
Lemon Squeezy + Ollama
 
Try it
Copy Model with Ollama API on New Subscription Created from Lemon Squeezy API
Lemon Squeezy + Ollama
 
Try it
Create Model with Ollama API on New Order Created from Lemon Squeezy API
Lemon Squeezy + Ollama
 
Try it
Create Model with Ollama API on New Subscription Created from Lemon Squeezy API
Lemon Squeezy + Ollama
 
Try it
New Order Created from the Lemon Squeezy API

Emit new event when a new order is created.

 
Try it
New Subscription Cancelled from the Lemon Squeezy API

Emit new event when a new subscription is cancelled.

 
Try it
New Subscription Created from the Lemon Squeezy API

Emit new event when a new subscription is created.

 
Try it
Retrieve A Customer with the Lemon Squeezy API

Retrive an existent customer. See docs here

 
Try it
Retrieve A Product with the Lemon Squeezy API

Retrive an existent product. See docs here

 
Try it
Retrieve An Order with the Lemon Squeezy API

Retrive an existent order. See docs here

 
Try it
Copy Model with the Ollama API

Copies a model, creating a model with another name from an existing model. See the documentation

 
Try it
Create Model with the Ollama API

Create a model from a modelfile. See the documentation

 
Try it

Explore Other Apps

1
-
0
of
2,500+
apps by most popular